XamlIsland Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines an object that enables an application to host fragments of XAML content.
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 524288)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class XamlIsland : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 524288)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class XamlIsland : System.IDisposable
Public Class XamlIsland
Implements IDisposable
- Inheritance
- Attributes
- Implements
Remarks
When a XamlIsland is created, it internally creates, manages, and exposes a **ContentIsland** object. This lets developers connect to the ContentIsland with their own **DesktopChildSiteBridge** and host XAML content on the XamlIsland.
The diagram illustrates the architecture of XamlIsland. At the core, a XamlIsland object is shown hosting XAML content. This XamlIsland internally manages a ContentIsland, which acts as a bridge between the XAML UI and the host application. The ContentIsland is connected to a DesktopChildSiteBridge, which enables integration with desktop applications. The flow demonstrates how XAML UI elements are rendered within the XamlIsland, passed through the ContentIsland, and made accessible to the host application via the DesktopChildSiteBridge. The diagram visually represents the separation of responsibilities and the connection points between the XAML content and the desktop environment.
**WebView2** is not supported when hosting XAML content in a XamlIsland. You must use **DesktopWindowXamlSource** instead.
Constructors
XamlIsland() |
Initializes a new instance of the **XamlIsland** class. |
Properties
Content |
Gets or sets the XAML content for the **XamlIsland** to host. |
ContentIsland |
Gets the **ContentIsland** associated with the **XamlIsland**. |
ShouldConstrainPopupsToWorkArea | |
SystemBackdrop |
Gets or sets the custom system backdrop used to render materials like Mica and Acrylic for the XamlIsland. |
Methods
Close() |
Disposes of the object and associated resources. |
Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |