Window.Current Proprietà

Definizione

Restituisce sempre null.

static Window Current();
/// [get: Windows.Foundation.Metadata.Deprecated("Window.Current is deprecated and always returns null in WinUI Desktop apps. For alternate ways to track instances of Window in your app code, visit https://aka.ms/win.current.alt", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Microsoft.UI.Xaml.WinUIContract")]
static Window Current();
public static Window Current { get; }
public static Window Current { [Windows.Foundation.Metadata.Deprecated("Window.Current is deprecated and always returns null in WinUI Desktop apps. For alternate ways to track instances of Window in your app code, visit https://aka.ms/win.current.alt", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Microsoft.UI.Xaml.WinUIContract")] get; }
var window = Window.current;
Public Shared ReadOnly Property Current As Window

Valore della proprietà

Sempre null.

Attributi

Commenti

In alternativa a Window.Current, è possibile tenere traccia delle istanze di Window nel codice dell'app. Per altre info, vedi gli articoli seguenti.

Note

La classe Window XAML include diverse proprietà che sono state spostate dalla piattaforma UWP Windows. UI. Classe Xaml.Window, ma non supportata nelle app WinUI. Queste proprietà hanno sempre un null valore e non vengono usate nelle app WinUI. Per altre informazioni, vedere Migrazione delle funzionalità di windowing.

Si applica a

Vedi anche