Skip to main content

Win32Properties Class

Definition

Assembly:Avalonia.Controls
Package:Avalonia

Set of Win32 specific properties and events that allow deeper customization of the application per platform.

public class Win32Properties

Inheritance: object -> Win32Properties

Methods

NameDescription
AddWindowStylesCallbackAdds a callback to set the window's style.
AddWndProcHookCallbackAdds a custom callback for the window's WndProc
GetNonClientHitTestResultGets the value of the NonClientHitTestResult attached property on the specified visual.
GetWindowCornerPreferenceGets the value of the WindowCornerPreference attached property on the specified window.
RemoveWindowStylesCallbackRemoves a callback to set the window's style.
RemoveWndProcHookCallbackRemoves a custom callback for the window's WndProc
SetNonClientHitTestResultSets the value of the NonClientHitTestResult attached property on the specified visual.
SetWindowCornerPreferenceSets 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

NameDescription
NonClientHitTestResultPropertyDefines the NonClientHitTestResult attached property.
WindowCornerPreferencePropertyDefines 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