WindowsXamlManager 類別

定義

表示非 UWP 傳統型應用程式中的 UWP XAML 架構 (,例如裝載 UWP 控制項的 WPF 或Windows Forms應用程式) 。

public ref class WindowsXamlManager sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Xaml.Hosting.HostingContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class WindowsXamlManager final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Xaml.Hosting.HostingContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class WindowsXamlManager : System.IDisposable
Public NotInheritable Class WindowsXamlManager
Implements IDisposable
繼承
Object Platform::Object IInspectable WindowsXamlManager
屬性
實作

Windows 需求

裝置系列
Windows Desktop Extension SDK (已於 10.0.17763.0 引進)
API contract
Windows.UI.Xaml.Hosting.HostingContract (已於 v3.0 引進)

備註

WindowsXamlManagerUWP XAML 裝載 API的一部分。 此 API 可讓非 UWP 傳統型應用程式裝載任何衍生自 Windows.UI.Xaml.UIElement 的控制項,) 與視窗控制碼相關聯, (HWND) 。 此 API 可供使用 WPF、Windows Forms和 Windows API (Win32) 建置的桌面應用程式使用。 如需詳細資訊,請參閱 在傳統型應用程式中使用 UWP XAML 裝載 API

WindowsXamlManager 提供靜態 InitializeForCurrentThread 方法,可用來初始化目前線程上的 UWP XAML 架構。

方法

Close()

關閉並非同步釋放這個 WindowsXamlManager所使用的任何資源。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

InitializeForCurrentThread()

初始化非 UWP 傳統型應用程式中的 UWP XAML 架構 (,例如,目前線程上的 WPF 或Windows Forms應用程式) 。

適用於

另請參閱