Skip to content

Xaml NativeComponent added to Sample Fabric#15626

Open
vineethkuttan wants to merge 3 commits intomicrosoft:mainfrom
vineethkuttan:xamlNativeComponent
Open

Xaml NativeComponent added to Sample Fabric#15626
vineethkuttan wants to merge 3 commits intomicrosoft:mainfrom
vineethkuttan:xamlNativeComponent

Conversation

@vineethkuttan
Copy link
Contributor

@vineethkuttan vineethkuttan commented Feb 4, 2026

Description

Adding a sample XAML Native Component to SAmpleAppFabric, t to ease out the testing part

Type of Change

  • Automation (AI changes or Github Actions to reduce effort of manual tasks)

Why

Will simplify the testing of Accessibility for XAML island

What

Added a Xaml Native Component and added in to the SampleFabricApp

Screenshots

xamlws.mp4

Testing

Tested in Sample Fabric

Changelog

Should this change be included in the release notes: no

Microsoft Reviewers: Open in CodeFlow

@vineethkuttan vineethkuttan marked this pull request as ready for review February 4, 2026 10:08
@vineethkuttan vineethkuttan requested a review from a team as a code owner February 4, 2026 10:08
m_comboBox.SelectionChangedTrigger(winrt::Microsoft::UI::Xaml::Controls::ComboBoxSelectionChangedTrigger::Always);

// Listen for size changes on the comboBox
m_comboBox.SizeChanged([this](auto const & /*sender*/, auto const & /*args*/) { RefreshSize(); });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to create Thread safety concerns? The lambda captures this but doesn't ensure the object lifetime. Consider using something like

auto weakThis = winrt::get_weak(*this);
m_comboBox.SizeChanged([weakThis](auto const & /*sender*/, auto const & /*args*/) {
    if (auto strongThis = weakThis.get()) {
        strongThis->RefreshSize();
    }
});

}>;

export interface PickerXamlProps extends ViewProps {
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a disabled prop for better accessibility support.


// Suspend event handlers during programmatic updates to avoid triggering
// change events. Using RAII ensures handlers are always re-attached.
WithEventsSuspended([&]() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good pattern to avoid recursive event firing during programmatic updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants