次の方法で共有


WindowsXamlManager クラス

定義

非Windows アプリ SDK (WASDK) デスクトップ アプリケーション (WPF やWindows フォーム アプリケーションなど) の WinUI XAML フレームワークを表します。

public ref class WindowsXamlManager sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 327680)]
/// [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(Microsoft.UI.Xaml.WinUIContract), 327680)]
[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
属性
実装

注釈

WindowsXamlManager は、Windows アプリ SDK XAML ホスティング API の一部です。 この API を使用すると、WASDK 以外のデスクトップ アプリケーションは、ウィンドウ ハンドル (HWND) に関連付けられている UI 要素で Microsoft.UI.Xaml.UIElement から派生したコントロールをホストできます。 この API は、WPF、Windows フォーム、Windows API (Win32) を使用して構築されたデスクトップ アプリケーションで使用できます。

WinAppSDK 1.4 から WinAppSDK 1.5 への変更

WinAppSDK 1.4 WinAppSDK 1.5 以降
XAML ランタイムは、スレッド上のすべてのWindowsXamlManagerおよび DesktopWindowXamlSource オブジェクトが閉じられたり破棄されたり、そのスレッドで実行されている DispatcherQueue がシャットダウンされた場合に、スレッドで非同期的にシャットダウンされます。 XAML ランタイムは、スレッドの DispatcherQueue がシャットダウンした場合にのみ、スレッドでシャットダウンします。
WindowsXamlManager.InitializeForCurrentThread は、呼び出されるたびに新しいオブジェクトを返します。 WindowsXamlManager.InitializeForCurrentThread は、スレッドの DispatcherQueue がシャットダウンするまで同じWindowsXamlManagerインスタンスを返します。

メソッド

Close()

この WindowsXamlManager で使用されるすべてのリソースを閉じて非同期的に解放します。

Dispose()

アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。

GetForCurrentThread()

現在のスレッドに WindowsXamlManager 関連付けられているオブジェクト (存在する場合) を取得します。

InitializeForCurrentThread()

現在のスレッドの非Windows アプリ SDK (WASDK) デスクトップ アプリケーション (WPF やWindows フォーム アプリケーションなど) で WinUI XAML フレームワークを初期化します。

イベント

XamlShutdownCompletedOnThread

XAML ランタイムが現在のスレッドでシャットダウン プロセスを完了したときに発生します。

適用対象

こちらもご覧ください