WindowUtilities Class

Provides utility methods and attached properties for WPF windows.

public static class WindowUtilities

Example

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:wpf="clr-namespace:Meziantou.Framework.WPF;assembly=Meziantou.Framework.WPF"
        wpf:WindowUtilities.CloseOnEscapeKeyDown="True">
</Window>

Methods

NameDescription
GetCloseOnEscapeKeyDown(DependencyObject)Gets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.
SetCloseOnEscapeKeyDown(DependencyObject, bool)Sets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.

GetCloseOnEscapeKeyDown(DependencyObject)

WindowUtilities.CloseOnEscapeKeyDown.cs

Gets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.

public static bool GetCloseOnEscapeKeyDown(DependencyObject d)

Parameters

d DependencyObject
The dependency object.

Returns

bool true if the window closes on Escape key down; otherwise, false.

SetCloseOnEscapeKeyDown(DependencyObject, bool)

WindowUtilities.CloseOnEscapeKeyDown.cs

Sets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.

public static void SetCloseOnEscapeKeyDown(DependencyObject d, bool value)

Parameters

d DependencyObject
The dependency object.
value bool
true to close the window on Escape key down; otherwise, false.

Fields

NameDescription
CloseOnEscapePropertyIdentifies the CloseOnEscapeKeyDown attached property.

CloseOnEscapeProperty

Identifies the CloseOnEscapeKeyDown attached property.

public static readonly DependencyProperty CloseOnEscapeProperty