Class ExtWpf
Adds extension methods for some WPF classes.
public static class ExtWpf
Namespace: Au.Types
Assembly: Au.dll
Methods
Name | Description |
---|---|
AddChild(Grid, UIElement, int, int, int, int) | Adds a child element in specified row/column. |
AddColumns(Grid, params WBGridLength[]) | Adds one or more columns. Like wpfBuilder.Columns, but does not clear existing columns. |
AddRows(Grid, params WBGridLength[]) | Adds one or more rows. Like wpfBuilder.Row. |
DpiChangedWorkaround(HwndSource) | Workaround for WPF bug: on DPI change tries to activate window. Call on WM_DPICHANED message or in OnDpiChanged override. Only if top-level window. |
DpiChangedWorkaround(Window) | Workaround for WPF bug: on DPI change tries to activate window. Call on WM_DPICHANED message or in OnDpiChanged override. |
FindVisualAncestor(DependencyObject, bool, Func<DependencyObject, bool>, object, bool) | Calls callback function f for each visual ancestor (System.Windows.Media.VisualTreeHelper.GetParent), and returns the ancestor for which f returns |
FindVisualAncestor<T>(DependencyObject, bool, object, bool) | Returns the nearest visual ancestor (System.Windows.Media.VisualTreeHelper.GetParent) of type T.
Also can return last or |
FindVisualDescendant(DependencyObject, Func<DependencyObject, bool>, bool) | Enumerates visual descendant objects, including parts of composite controls, and calls callback function f for each.
When f returns |
FormOwner(Window) | Gets IWin32Window of this window for System.Windows.Forms functions like Form.ShowDialog and ColorDialog.ShowDialog. |
HideGripAndOverflow(ToolBar, bool, bool) | Hides the grip and/or overflow controls in this toolbar. Call before the toolbar is loaded. |
Hwnd(DependencyObject) | Gets native window handle of this Window or Popup, or container window handle of this child object. |
InsertColumn(Grid, int, ColumnDefinition) | Inserts column and adjusts column indices of children that are in other columns. |
InsertRow(Grid, int, RowDefinition) | Inserts row and adjusts row indices of children that are in other rows. |
LogicalDescendants(DependencyObject) | Enumerates logical descendant objects, including parts of composite controls. |
Preview(Window) | Shows the window in preview mode. |
RectInScreen(FrameworkElement) | Gets rectangle of this element in screen coordinates. |
RemoveColumn(Grid, int, bool) | Removes column and adjusts column indices of children that are in other columns. |
RemoveColumn(Grid, UIElement, bool) | Removes a child element and its column from this grid. Adjusts column indices of children that are in other columns. |
RemoveRow(Grid, int, bool) | Removes row and adjusts row indices of children that are in other rows. |
RemoveRow(Grid, UIElement, bool) | Removes a child element and its row from this grid. Adjusts row indices of children that are in other rows. |
SetRect(Window, RECT) | Sets window startup rectangle (location and size) before showing it first time. Also can move/resize already loaded window. |
SetXY(Window, int, int) | Sets window startup location before showing it first time. Also can move already loaded window. |
TextOrNull(TextBox) | Gets the Text property. Returns |
UiaClick(Button) | Calls System.Windows.Automation.Provider.IInvokeProvider.Invoke, which sends a request to click the button. Note: it's async; more info in Remarks. |
UiaSetName(DependencyObject, string) | Sets UI Automation name. |
VisualAncestors(DependencyObject, bool, object) | Gets visual ancestors (System.Windows.Media.VisualTreeHelper.GetParent). |
VisualDescendants(DependencyObject) | Enumerates visual descendant objects, including parts of composite controls. |