Win32Properties Class
Definition
Set of Win32 specific properties and events that allow deeper customization of the application per platform.
public class Win32Properties
Methods
| Name | Description |
|---|---|
| AddWindowStylesCallback | Adds a callback to set the window's style. |
| AddWndProcHookCallback | Adds a custom callback for the window's WndProc |
| GetNonClientHitTestResult | Gets the value of the NonClientHitTestResult attached property on the specified visual. |
| GetWindowCornerPreference | Gets the value of the WindowCornerPreference attached property on the specified window. |
| RemoveWindowStylesCallback | Removes a callback to set the window's style. |
| RemoveWndProcHookCallback | Removes a custom callback for the window's WndProc |
| SetNonClientHitTestResult | Sets the value of the NonClientHitTestResult attached property on the specified visual. |
| SetWindowCornerPreference | Sets the value of the WindowCornerPreference attached property on the specified window. |
AddWindowStylesCallback Method
Adds a callback to set the window's style.
public void AddWindowStylesCallback(Avalonia.Controls.TopLevel topLevel, Avalonia.Controls.Win32Properties.CustomWindowStylesCallback callback)
Parameters
topLevel Avalonia.Controls.TopLevel
The window implementation
callback Avalonia.Controls.Win32Properties.CustomWindowStylesCallback
The callback
AddWndProcHookCallback Method
Adds a custom callback for the window's WndProc
public void AddWndProcHookCallback(Avalonia.Controls.TopLevel topLevel, Avalonia.Controls.Win32Properties.CustomWndProcHookCallback callback)
Parameters
topLevel Avalonia.Controls.TopLevel
The window
callback Avalonia.Controls.Win32Properties.CustomWndProcHookCallback
The callback
GetNonClientHitTestResult Method
Gets the value of the NonClientHitTestResult attached property on the specified visual.
public Avalonia.Controls.Win32Properties.Win32HitTestValue GetNonClientHitTestResult(Avalonia.Visual obj)
Parameters
obj Avalonia.Visual
The visual.
Returns
Avalonia.Controls.Win32Properties.Win32HitTestValue
The hit test value for obj.
GetWindowCornerPreference Method
Gets the value of the WindowCornerPreference attached property on the specified window.
public Avalonia.Controls.Win32Properties.WindowCornerPreference GetWindowCornerPreference(Avalonia.Controls.Window window)
Parameters
window Avalonia.Controls.Window
The window.
Returns
Avalonia.Controls.Win32Properties.WindowCornerPreference
The window corner preference for window.
RemoveWindowStylesCallback Method
Removes a callback to set the window's style.
public void RemoveWindowStylesCallback(Avalonia.Controls.TopLevel topLevel, Avalonia.Controls.Win32Properties.CustomWindowStylesCallback callback)
Parameters
topLevel Avalonia.Controls.TopLevel
The window implementation
callback Avalonia.Controls.Win32Properties.CustomWindowStylesCallback
The callback
RemoveWndProcHookCallback Method
Removes a custom callback for the window's WndProc
public void RemoveWndProcHookCallback(Avalonia.Controls.TopLevel topLevel, Avalonia.Controls.Win32Properties.CustomWndProcHookCallback callback)
Parameters
topLevel Avalonia.Controls.TopLevel
The window
callback Avalonia.Controls.Win32Properties.CustomWndProcHookCallback
The callback
SetNonClientHitTestResult Method
Sets the value of the NonClientHitTestResult attached property on the specified visual.
public void SetNonClientHitTestResult(Avalonia.Visual obj, Avalonia.Controls.Win32Properties.Win32HitTestValue value)
Parameters
obj Avalonia.Visual
The visual.
value Avalonia.Controls.Win32Properties.Win32HitTestValue
The value to set.
SetWindowCornerPreference Method
Sets the value of the WindowCornerPreference attached property on the specified window.
public void SetWindowCornerPreference(Avalonia.Controls.Window window, Avalonia.Controls.Win32Properties.WindowCornerPreference value)
Parameters
window Avalonia.Controls.Window
The window.
value Avalonia.Controls.Win32Properties.WindowCornerPreference
The value to set.
Remarks
This value is supported starting with Windows 11 Build 22000. It is ignored on earlier Windows versions.
Fields
| Name | Description |
|---|---|
| NonClientHitTestResultProperty | Defines the NonClientHitTestResult attached property. |
| WindowCornerPreferenceProperty | Defines the WindowCornerPreferenceProperty attached property. |
NonClientHitTestResultProperty Field
Defines the NonClientHitTestResult attached property.
public Avalonia.AttachedProperty<Avalonia.Controls.Win32Properties.Win32HitTestValue> NonClientHitTestResultProperty
WindowCornerPreferenceProperty Field
Defines the WindowCornerPreferenceProperty attached property.
public Avalonia.AttachedProperty<Avalonia.Controls.Win32Properties.WindowCornerPreference> WindowCornerPreferenceProperty