CINXE.COM

XamlUIService · React Native for Windows + macOS

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>XamlUIService · React Native for Windows + macOS</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="generator" content="Docusaurus"/><meta name="description" content="Kind: `class`"/><meta name="docsearch:version" content="0.76"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="XamlUIService · React Native for Windows + macOS"/><meta property="og:type" content="website"/><meta property="og:url" content="https://microsoft.github.io/react-native-windows/"/><meta property="og:description" content="Kind: `class`"/><meta property="og:image" content="https://microsoft.github.io/react-native-windows/img/undraw_online.svg"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://microsoft.github.io/react-native-windows/img/undraw_tweetstorm.svg"/><link rel="shortcut icon" href="/react-native-windows/img/favicon.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="stylesheet" href="/react-native-windows/css/code-block-buttons.css"/><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/focus-visible@5.0.2/dist/focus-visible.min.js"></script><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/react-native-windows/js/code-block-buttons.js"></script><script type="text/javascript" src="/react-native-windows/js/nav-buttons.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script> document.addEventListener('DOMContentLoaded', function() { addBackToTop( {"zIndex":100} ) }); </script><script src="/react-native-windows/js/scrollSpy.js"></script><link rel="stylesheet" href="/react-native-windows/css/prism.css"/><link rel="stylesheet" href="/react-native-windows/css/main.css"/><script src="/react-native-windows/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/react-native-windows/"><img class="logo" src="/react-native-windows/img/header_logo.svg" alt="React Native for Windows + macOS"/><h2 class="headerTitleWithLogo">React Native for Windows + macOS</h2></a><a href="/react-native-windows/versions"><h3>0.76</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/react-native-windows/docs/getting-started" target="_self">Docs</a></li><li class="siteNavGroupActive"><a href="/react-native-windows/docs/flyout-component" target="_self">APIs</a></li><li class=""><a href="https://devblogs.microsoft.com/react-native/" target="_self">Blog</a></li><li class=""><a href="/react-native-windows/resources" target="_self">Resources</a></li><li class=""><a href="https://github.com/microsoft/react-native-windows-samples/tree/main/samples" target="_self">Samples</a></li><li class=""><a href="/react-native-windows/support" target="_self">Support</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>Native API (Windows)</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Components (Windows)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/flyout-component">Flyout</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/glyph-component">Glyph</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/popup-component">Popup</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/textinput-component">TextInput</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">JavaScript API (Windows)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/apptheme-api">AppTheme</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/ikeyboardprops-api">IKeyboardProps</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/iviewwindowsprops-api">IViewWindowsProps</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Native API (Windows)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IJSValueReader">IJSValueReader</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IJSValueWriter">IJSValueWriter</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactContext">IReactContext</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactDispatcher">IReactDispatcher</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactModuleBuilder">IReactModuleBuilder</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactNonAbiValue">IReactNonAbiValue</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactPackageBuilder">IReactPackageBuilder</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactPackageProvider">IReactPackageProvider</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IReactPropertyBag">IReactPropertyBag</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IRedBoxHandler">IRedBoxHandler</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/IViewManager">IViewManager</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/ReactApplication">ReactApplication</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/ReactInstanceSettings">ReactInstanceSettings</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/ReactNativeHost">ReactNativeHost</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/react-native-windows/docs/native-api/XamlUIService">XamlUIService</a></li><li class="navListItem"><a class="navItem" href="/react-native-windows/docs/native-api/Native-API-Reference">Full reference</a></li></ul></div></div></section></div><script> var coll = document.getElementsByClassName('collapsible'); var checkActiveCategory = true; for (var i = 0; i < coll.length; i++) { var links = coll[i].nextElementSibling.getElementsByTagName('*'); if (checkActiveCategory){ for (var j = 0; j < links.length; j++) { if (links[j].classList.contains('navListItemActive')){ coll[i].nextElementSibling.classList.toggle('hide'); coll[i].childNodes[1].classList.toggle('rotate'); checkActiveCategory = false; break; } } } coll[i].addEventListener('click', function() { var arrow = this.childNodes[1]; arrow.classList.toggle('rotate'); var content = this.nextElementSibling; content.classList.toggle('hide'); }); } document.addEventListener('DOMContentLoaded', function() { createToggler('#navToggler', '#docsNav', 'docsSliderActive'); createToggler('#tocToggler', 'body', 'tocActive'); var headings = document.querySelector('.toc-headings'); headings && headings.addEventListener('click', function(event) { var el = event.target; while(el !== headings){ if (el.tagName === 'A') { document.body.classList.remove('tocActive'); break; } else{ el = el.parentNode; } } }, false); function createToggler(togglerSelector, targetSelector, className) { var toggler = document.querySelector(togglerSelector); var target = document.querySelector(targetSelector); if (!toggler) { return; } toggler.onclick = function(event) { event.preventDefault(); target.classList.toggle(className); }; } }); </script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/microsoft/react-native-windows-samples/blob/main/docs/native-api/XamlUIService-api-windows.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">XamlUIService</h1></header><article><div><span><p>Kind: <code>class</code></p> <p>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.</p> <h2><a class="anchor" aria-hidden="true" id="methods"></a><a href="#methods" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Methods</h2> <h3><a class="anchor" aria-hidden="true" id="dispatchevent"></a><a href="#dispatchevent" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>DispatchEvent</h3> <p>void <strong><code>DispatchEvent</code></strong>(<a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> view, string eventName, <a href="JSValueArgWriter"><code>JSValueArgWriter</code></a> eventDataArgWriter)</p> <p>Dispatches an event to a JS component.</p> <h3><a class="anchor" aria-hidden="true" id="elementfromreacttag"></a><a href="#elementfromreacttag" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>ElementFromReactTag</h3> <p><a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.DependencyObject"><code>DependencyObject</code></a> <strong><code>ElementFromReactTag</code></strong>(int64_t reactTag)</p> <p>Gets the backing XAML element from a react tag.</p> <h3><a class="anchor" aria-hidden="true" id="fromcontext"></a><a href="#fromcontext" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>FromContext</h3> <p><code>static</code> <a href="XamlUIService"><code>XamlUIService</code></a> <strong><code>FromContext</code></strong>(<a href="IReactContext"><code>IReactContext</code></a> context)</p> <p>Use this method to get access to the <a href="XamlUIService"><code>XamlUIService</code></a> associated with the <a href="IReactContext"><code>IReactContext</code></a>.</p> <h3><a class="anchor" aria-hidden="true" id="getaccessibleroot"></a><a href="#getaccessibleroot" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>GetAccessibleRoot</h3> <p><code>static</code> <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> <strong><code>GetAccessibleRoot</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties)</p> <p>Retrieves the default <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> that will be used for the app for accessibility purposes (e.g. to announce).</p> <h3><a class="anchor" aria-hidden="true" id="getislandwindowhandle"></a><a href="#getislandwindowhandle" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>GetIslandWindowHandle</h3> <p><code>static</code> uint64_t <strong><code>GetIslandWindowHandle</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties)</p> <p>Gets the window handle HWND (as an UInt64) used as the XAML Island window for the current React instance.</p> <h3><a class="anchor" aria-hidden="true" id="getreactrootview"></a><a href="#getreactrootview" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>GetReactRootView</h3> <p><a href="ReactRootView"><code>ReactRootView</code></a> <strong><code>GetReactRootView</code></strong>(<a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> view)</p> <p>Gets the <a href="ReactRootView"><code>ReactRootView</code></a> view for a given element.</p> <h3><a class="anchor" aria-hidden="true" id="getxamlroot"></a><a href="#getxamlroot" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>GetXamlRoot</h3> <p><code>static</code> <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.XamlRoot"><code>XamlRoot</code></a> <strong><code>GetXamlRoot</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties)</p> <p>Retrieves the default <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.XamlRoot"><code>XamlRoot</code></a> for the app.</p> <h3><a class="anchor" aria-hidden="true" id="setaccessibleroot"></a><a href="#setaccessibleroot" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>SetAccessibleRoot</h3> <p><code>static</code> void <strong><code>SetAccessibleRoot</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties, <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> accessibleRoot)</p> <p>Sets the <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.FrameworkElement"><code>FrameworkElement</code></a> that will act as the default accessible element for the app. The element must be able to create an automation peer (see <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Automation.Peers.FrameworkElementAutomationPeer"><code>FrameworkElementAutomationPeer</code></a>), or have the Landmark type property set (see <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Automation.AutomationProperties.LandmarkTypeProperty"><code>AutomationProperties.LandmarkTypeProperty</code></a>). This must be manually provided to the <a href="ReactInstanceSettings"><code>ReactInstanceSettings</code></a> when using XAML Islands to have access to functionality related to accessibility.</p> <h3><a class="anchor" aria-hidden="true" id="setislandwindowhandle"></a><a href="#setislandwindowhandle" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>SetIslandWindowHandle</h3> <p><code>static</code> void <strong><code>SetIslandWindowHandle</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties, uint64_t windowHandle)</p> <p>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.</p> <h3><a class="anchor" aria-hidden="true" id="setxamlroot"></a><a href="#setxamlroot" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>SetXamlRoot</h3> <p><code>static</code> void <strong><code>SetXamlRoot</code></strong>(<a href="IReactPropertyBag"><code>IReactPropertyBag</code></a> properties, <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.XamlRoot"><code>XamlRoot</code></a> xamlRoot)</p> <p>Sets the <a href="https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.XamlRoot"><code>XamlRoot</code></a> element for the app. This must be manually provided to the <a href="ReactInstanceSettings"><code>ReactInstanceSettings</code></a> object when using XAML Islands so that certain APIs work correctly. For more information, see <a href="https://docs.microsoft.com/windows/apps/desktop/modernize/xaml-islands">Host WinRT XAML Controls in desktop apps (XAML Islands)</a>.</p> </span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/react-native-windows/docs/native-api/ReactNativeHost"><span class="arrow-prev">← </span><span class="function-name-prevnext">ReactNativeHost</span></a><a class="docs-next button" href="/react-native-windows/docs/native-api/Native-API-Reference"><span>Full reference</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#methods">Methods</a><ul class="toc-headings"><li><a href="#dispatchevent">DispatchEvent</a></li><li><a href="#elementfromreacttag">ElementFromReactTag</a></li><li><a href="#fromcontext">FromContext</a></li><li><a href="#getaccessibleroot">GetAccessibleRoot</a></li><li><a href="#getislandwindowhandle">GetIslandWindowHandle</a></li><li><a href="#getreactrootview">GetReactRootView</a></li><li><a href="#getxamlroot">GetXamlRoot</a></li><li><a href="#setaccessibleroot">SetAccessibleRoot</a></li><li><a href="#setislandwindowhandle">SetIslandWindowHandle</a></li><li><a href="#setxamlroot">SetXamlRoot</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><div><h5>React Native Docs</h5><a href="https://reactnative.dev/docs/getting-started">Getting Started</a><a href="https://reactnative.dev/docs/tutorial">Tutorial</a><a href="https://reactnative.dev/docs/components-and-apis">Components and APIs</a><a href="https://reactnative.dev/docs/more-resources">More Resources</a></div><div><h5>React Native for Windows + macOS Docs</h5><div style="color:white;font-weight:500;font-size:16px"><a href="/react-native-windows/docs/getting-started">Get Started with Windows</a></div><div style="color:white;font-weight:500;font-size:16px"><a href="/react-native-windows/docs/rnm-getting-started"> Get Started with macOS</a></div><a href="/react-native-windows/docs/parity-status">React Native Windows Components and APIs</a><a href="/react-native-windows/docs/native-modules">Native Modules</a><a href="/react-native-windows/docs/view-managers">Native UI Components</a></div><div><h5>Connect With Us On</h5><a href="https://devblogs.microsoft.com/react-native/">Blog</a><a href="https://twitter.com/ReactNativeMSFT" target="_blank">Twitter</a><a href="https://github.com/microsoft/react-native-windows" target="_blank">GitHub</a><a href="https://github.com/microsoft/react-native-windows-samples/tree/main/samples" target="_blank">Samples</a></div></section></footer></div></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10