Skip to content
Discussion options

You must be logged in to vote

In 12.0.1 the attached property exists, but the name in XAML is WindowDecorationProperties.ElementRole, not WindowDecorations.ElementRole.

For controls inside the titlebar area that should receive input, mark them as user-interactive decoration elements:

<Button
  WindowDecorationProperties.ElementRole="User"
  Content="Back" />

<TextBox
  WindowDecorationProperties.ElementRole="User"
  Watermark="Search" />

If your XAML file does not resolve the type from the default Avalonia namespace, add the namespace explicitly:

xmlns:chrome="using:Avalonia.Controls.Chrome"

and then use:

chrome:WindowDecorationProperties.ElementRole="User"

The enum type behind it is Avalonia.Input.WindowDecorationsE…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CADTraveller
Comment options

Answer selected by CADTraveller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants