WindowUtilities Class
Provides utility methods and attached properties for WPF windows.
public static class WindowUtilitiesExample
<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
| Name | Description |
|---|---|
| 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.csGets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.
public static bool GetCloseOnEscapeKeyDown(DependencyObject d)Parameters
dDependencyObject- The dependency object.
Returns
bool true if the window closes on Escape key down; otherwise, false.
SetCloseOnEscapeKeyDown(DependencyObject, bool)
WindowUtilities.CloseOnEscapeKeyDown.csSets the value of the CloseOnEscapeKeyDown attached property for a specified dependency object.
public static void SetCloseOnEscapeKeyDown(DependencyObject d, bool value)Parameters
dDependencyObject- The dependency object.
valuebooltrueto close the window on Escape key down; otherwise,false.
Fields
| Name | Description |
|---|---|
| CloseOnEscapeProperty | Identifies the CloseOnEscapeKeyDown attached property. |
CloseOnEscapeProperty
Identifies the CloseOnEscapeKeyDown attached property.
public static readonly DependencyProperty CloseOnEscapeProperty