Skip to main content

XamlUIService

New Architecture

Kind: class

Provides access to XAML UI-specific functionality. It provides access to APIs to get a XAML element from a react tag, and to dispatch events to JS components.

Methods

FromContext

static XamlUIService FromContext(IReactContext context)

Use this method to get access to the XamlUIService associated with the IReactContext.

GetAccessibleRoot

static FrameworkElement GetAccessibleRoot(IReactPropertyBag properties)

Retrieves the default FrameworkElement that will be used for the app for accessibility purposes (e.g. to announce).

GetIslandWindowHandle

static uint64_t GetIslandWindowHandle(IReactPropertyBag properties)

Gets the window handle HWND (as an UInt64) used as the XAML Island window for the current React instance.

GetXamlRoot

static XamlRoot GetXamlRoot(IReactPropertyBag properties)

Retrieves the default XamlRoot for the app.

SetAccessibleRoot

static void SetAccessibleRoot(IReactPropertyBag properties, FrameworkElement accessibleRoot)

Sets the FrameworkElement that will act as the default accessible element for the app. The element must be able to create an automation peer (see FrameworkElementAutomationPeer), or have the Landmark type property set (see AutomationProperties.LandmarkTypeProperty). This must be manually provided to the ReactInstanceSettings when using XAML Islands to have access to functionality related to accessibility.

SetIslandWindowHandle

static void SetIslandWindowHandle(IReactPropertyBag properties, uint64_t windowHandle)

Sets the windowHandle HWND (as an UInt64) to be the XAML Island window for the current React instance. Pass the value returned by IDesktopWindowXamlSourceNative get_WindowHandle.

SetXamlRoot

static void SetXamlRoot(IReactPropertyBag properties, XamlRoot xamlRoot)

Sets the XamlRoot element for the app. This must be manually provided to the ReactInstanceSettings object when using XAML Islands so that certain APIs work correctly. For more information, see Host WinRT XAML Controls in desktop apps (XAML Islands).

Old Architecture

Kind: class

Provides access to XAML UI-specific functionality. It provides access to APIs to get a XAML element from a react tag, and to dispatch events to JS components.

Methods

DispatchEvent

void DispatchEvent(FrameworkElement view, string eventName, JSValueArgWriter eventDataArgWriter)

Dispatches an event to a JS component.

ElementFromReactTag

DependencyObject ElementFromReactTag(int64_t reactTag)

Gets the backing XAML element from a react tag.

FromContext

static XamlUIService FromContext(IReactContext context)

Use this method to get access to the XamlUIService associated with the IReactContext.

GetAccessibleRoot

static FrameworkElement GetAccessibleRoot(IReactPropertyBag properties)

Retrieves the default FrameworkElement that will be used for the app for accessibility purposes (e.g. to announce).

GetIslandWindowHandle

static uint64_t GetIslandWindowHandle(IReactPropertyBag properties)

Gets the window handle HWND (as an UInt64) used as the XAML Island window for the current React instance.

GetReactRootView

ReactRootView GetReactRootView(FrameworkElement view)

Gets the ReactRootView view for a given element.

GetXamlRoot

static XamlRoot GetXamlRoot(IReactPropertyBag properties)

Retrieves the default XamlRoot for the app.

SetAccessibleRoot

static void SetAccessibleRoot(IReactPropertyBag properties, FrameworkElement accessibleRoot)

Sets the FrameworkElement that will act as the default accessible element for the app. The element must be able to create an automation peer (see FrameworkElementAutomationPeer), or have the Landmark type property set (see AutomationProperties.LandmarkTypeProperty). This must be manually provided to the ReactInstanceSettings when using XAML Islands to have access to functionality related to accessibility.

SetIslandWindowHandle

static void SetIslandWindowHandle(IReactPropertyBag properties, uint64_t windowHandle)

Sets the windowHandle HWND (as an UInt64) to be the XAML Island window for the current React instance. Pass the value returned by IDesktopWindowXamlSourceNative get_WindowHandle.

SetXamlRoot

static void SetXamlRoot(IReactPropertyBag properties, XamlRoot xamlRoot)

Sets the XamlRoot element for the app. This must be manually provided to the ReactInstanceSettings object when using XAML Islands so that certain APIs work correctly. For more information, see Host WinRT XAML Controls in desktop apps (XAML Islands).