Show / Hide Table of Contents

Class WindowExtensions

WinUI Window Extension Methods

Inheritance
object
WindowExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: WinUIEx
Assembly: WinUIEx.dll
Syntax
public static class WindowExtensions

Methods

Name Description
CenterOnScreen(Window, double?, double?)

Centers the window on the current monitor

CreateFolderPicker(Window)

Creates a new instance of a FolderPicker with the provided window as a parent.

CreateMessageDialog(Window, string, string)

Initializes a new instance of the MessageDialog class with the provided window as a parent to display a titled message dialog that can be used to ask your user simple questions.

CreateOpenFilePicker(Window)

Creates a new instance of a FileOpenPicker with the provided window as a parent.

CreateSaveFilePicker(Window)

Creates a new instance of a FileSavePicker with the provided window as a parent.

GetAppWindow(Window)

Gets the AppWindow from the handle

GetAppWindowFromWindowHandle(nint)

Gets the AppWindow from an HWND

GetDpiForWindow(Window)

Returns the dots per inch (dpi) value for the associated window.

GetExtendedWindowStyle(Window)

Gets the current window style

GetIsAlwaysOnTop(Window)

Gets a value indicating whether this window is on top or not.

GetIsMaximizable(Window)

Gets a value indicating whether this window is maximizeable or not.

GetIsMinimizable(Window)

Gets a value indicating whether this window is minimizeable or not.

GetIsResizable(Window)

Gets a value indicating whether this resizable or not.

GetWindowHandle(WindowId)

Gets the window HWND handle from a Window ID.

GetWindowHandle(Window)

Gets the native HWND pointer handle for the window

GetWindowStyle(Window)

Gets the current window style

Hide(Window)

Hides the window and activates another window.

Maximize(Window)

Maximizes the specified window.

Minimize(Window)

Minimizes the specified window and activates the next top-level window in the Z order.

Move(Window, int, int)

Positions the window

MoveAndResize(Window, double, double, double, double)

Positions and resizes the window

Restore(Window)

Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position.

SetExtendedWindowStyle(Window, ExtendedWindowStyle)

Sets the current window style

SetForegroundWindow(Window)

Brings the thread that created the specified window into the foreground and activates the window.

SetIcon(Window, IconId)

Sets the icon for the window, using the specified icon ID.

SetIcon(Window, string)

Sets the icon for the window, using the specified icon path.

SetIsAlwaysOnTop(Window, bool)

Configures whether the window should always be displayed on top of other windows or not

SetIsMaximizable(Window, bool)
SetIsMinimizable(Window, bool)
SetIsResizable(Window, bool)

Enables or disables the ability to resize the window.

SetIsShownInSwitchers(Window, bool)

Enables or disables showing the window in the task switchers.

SetTaskBarIcon(Window, Icon?)

Sets the task bar icon to the provided icon

SetTitleBarBackgroundColors(Window, Color)

Gets the background color for the title bar and all its buttons and their states.

SetWindowOpacity(Window, byte)

Sets the opacity of a layered window.

SetWindowPresenter(Window, AppWindowPresenterKind)

Sets the window presenter kind used.

SetWindowSize(Window, double, double)

Sets the width and height of the window in device-independent pixels.

SetWindowStyle(Window, WindowStyle)

Sets the current window style

Show(Window)

Activates the window and displays it in its current size and position.

ToggleExtendedWindowStyle(Window, bool, ExtendedWindowStyle)

Disables or enables the window style

ToggleWindowStyle(Window, bool, WindowStyle)

Disables or enables the window style

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX