Window.Current Property
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.
Always returns null.
static Window Current();
public static Window Current { get; }
var window = Window.current;
Public Shared ReadOnly Property Current As Window
Property Value
Always null.
Remarks
As an alternative to Window.Current, you can track instances of Window in your app code. For more info, see the following articles.
- If your app has a single window: Windowing overview for WinUI and Windows App SDK.
- If your app has multiple windows: Show multiple windows for your app.
Note
The XAML Window class has several properties that were carried over from the UWP Windows.UI.Xaml.Window class, but are not supported in WinUI apps. These properties always have a null value and are not used in WinUI apps. For more info, see Windowing functionality migration.