Show / Hide Table of Contents

Class WindowEx

A custom WinUI Window with more convenience methods

Inheritance
object
Window
WindowEx
Implements
IWinRTObject
IDynamicInterfaceCastable
IEquatable<Window>
Inherited Members
Window.As<I>()
Window.FromAbi(nint)
Window.Equals(Window)
Window.Equals(object)
Window.GetHashCode()
Window.Activate()
Window.Close()
Window.SetTitleBar(UIElement)
Window.IsOverridableInterface(Guid)
Window.Current
Window.Bounds
Window.Compositor
Window.Content
Window.CoreWindow
Window.Dispatcher
Window.DispatcherQueue
Window.ExtendsContentIntoTitleBar
Window.SystemBackdrop
Window.Visible
Window.Activated
Window.Closed
Window.SizeChanged
Window.VisibilityChanged
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: WinUIEx
Assembly: WinUIEx.dll
Syntax
[ContentProperty(Name = "WindowContent")]
public class WindowEx : Window, IWinRTObject, IDynamicInterfaceCastable, IEquatable<Window>

Constructors

Name Description
WindowEx()

Initializes a new instance of the WindowEx class.

Properties

Name Description
AppWindow

Gets a reference to the AppWindow for the app

Height

Gets or sets the height of the window

IsAlwaysOnTop

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

IsMaximizable

Gets or sets a value indicating whether the maximimze button is visible

IsMinimizable

Gets or sets a value indicating whether the minimize button is visible

IsResizable

Gets or sets a value indicating whether the window can be resized.

IsShownInSwitchers

Gets or sets a value indicating whether this window is shown in task switchers.

IsTitleBarVisible

Gets or sets a value indicating whether the default title bar is visible or not.

IsVisibleInTray

Gets or sets a value indicating whether the window is shown in the system tray.

MaxHeight

Gets or sets the maximum height of this window

MaxWidth

Gets or sets the maximum width of this window

MinHeight

Gets or sets the minimum height of this window

MinWidth

Gets or sets the minimum width of this window

PersistenceId

Gets or sets a unique ID used for saving and restoring window size and position across sessions.

Presenter

Gets the presenter for the current window

PresenterKind

Gets or sets the presenter kind for the current window

TaskBarIcon

Gets or sets the task bar icon.

Title

Gets or sets the window title.

Width

Gets or sets the width of the window

WindowContent

Gets or sets the Window content

WindowState

Gets or sets the current window state.

Methods

Name Description
BringToFront()

Brings the window to the front

OnPositionChanged(PointInt32)

Called when the window position changed.

OnPresenterChanged(AppWindowPresenter)

Called when the presenter for the window changed.

OnSizeChanged(Size)

Called when the size of the window changes.

OnStateChanged(WindowState)

Called when the WindowState changed.

OnZOrderChanged(ZOrderInfo)

Called when the Z order of the window changed.

ShowMessageDialogAsync(string, IList<IUICommand>?, uint, uint, string)

Shows a message dialog

ShowMessageDialogAsync(string, string)

Shows a message dialog

Events

Name Description
PositionChanged

Raised if the window position changes.

PresenterChanged

Raised if the presenter for the window changed.

WindowStateChanged

Occurs when the window's WindowState property changes.

ZOrderChanged

Raised if the Z order of the window changed.

Extension Methods

WindowExtensions.CenterOnScreen(Window, double?, double?)
WindowExtensions.CreateFolderPicker(Window)
WindowExtensions.CreateMessageDialog(Window, string, string)
WindowExtensions.CreateOpenFilePicker(Window)
WindowExtensions.CreateSaveFilePicker(Window)
WindowExtensions.GetAppWindow(Window)
WindowExtensions.GetDpiForWindow(Window)
WindowExtensions.GetExtendedWindowStyle(Window)
WindowExtensions.GetIsAlwaysOnTop(Window)
WindowExtensions.GetIsMaximizable(Window)
WindowExtensions.GetIsMinimizable(Window)
WindowExtensions.GetIsResizable(Window)
WindowExtensions.GetWindowHandle(Window)
WindowExtensions.GetWindowStyle(Window)
WindowExtensions.Hide(Window)
WindowExtensions.Maximize(Window)
WindowExtensions.Minimize(Window)
WindowExtensions.Move(Window, int, int)
WindowExtensions.MoveAndResize(Window, double, double, double, double)
WindowExtensions.Restore(Window)
WindowExtensions.SetExtendedWindowStyle(Window, ExtendedWindowStyle)
WindowExtensions.SetForegroundWindow(Window)
WindowExtensions.SetIcon(Window, IconId)
WindowExtensions.SetIcon(Window, string)
WindowExtensions.SetIsAlwaysOnTop(Window, bool)
WindowExtensions.SetIsMaximizable(Window, bool)
WindowExtensions.SetIsMinimizable(Window, bool)
WindowExtensions.SetIsResizable(Window, bool)
WindowExtensions.SetIsShownInSwitchers(Window, bool)
WindowExtensions.SetTaskBarIcon(Window, Icon?)
WindowExtensions.SetTitleBarBackgroundColors(Window, Color)
WindowExtensions.SetWindowOpacity(Window, byte)
WindowExtensions.SetWindowPresenter(Window, AppWindowPresenterKind)
WindowExtensions.SetWindowSize(Window, double, double)
WindowExtensions.SetWindowStyle(Window, WindowStyle)
WindowExtensions.Show(Window)
WindowExtensions.ToggleExtendedWindowStyle(Window, bool, ExtendedWindowStyle)
WindowExtensions.ToggleWindowStyle(Window, bool, WindowStyle)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX