Class WpfWindowExtensions
Contains extensions for the Window and IWpfWindow classes.
Inherited Members
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Wpf.Common.dll
Syntax
public static class WpfWindowExtensions
Methods
| Edit this page View SourceHookHelp(Window, HandledEventHandler)
Enables the Windows help button on a window and attaches a handler for its click event.
Declaration
public static void HookHelp(this Window window, HandledEventHandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Window | window | Window in which to enable the help button. |
| HandledEventHandler | handler | Delegate that defines the action to execute when the window's help button is clicked. |
HookHelp(IWpfWindow, HandledEventHandler)
Enables the Windows help button on a window and attaches a handler for its click event.
Declaration
public static void HookHelp(this IWpfWindow window, HandledEventHandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| IWpfWindow | window | Window in which to enable the help button. |
| HandledEventHandler | handler | Delegate that defines the action to execute when the window's help button is clicked. |
PerformWindowDrag(Window?, int, MouseButtonEventArgs)
Performs a window drag operation.
Declaration
public static void PerformWindowDrag(this Window? window, int rightChromeWidth, MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Window | window | The window to drag. |
| int | rightChromeWidth | Width of the area left of the window chrome to exclude from the drag position calculation. Used when restoring a maximized window that has user‑defined chrome; it equals the sum of the widths of controls left of the chrome. |
| MouseButtonEventArgs | e | Drag arguments generated in the MouseDown event of the control used as the drag point. |
Remarks
This method can be attached to a MouseDown event of a control that can serve as a drag point for a WPF window.
PerformWindowDrag(Window?, MouseButtonEventArgs)
Performs a window drag operation.
Declaration
public static void PerformWindowDrag(this Window? window, MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Window | window | The window to drag. |
| MouseButtonEventArgs | e | Drag arguments generated in the MouseDown event of the control used as the drag point. |