AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.93k stars 2.24k forks source link

The window adorner is not rendering #8836

Closed ymg2006 closed 2 years ago

ymg2006 commented 2 years ago

Hello, The window adorner is not rendering.

To Reproduce Create a simple Avalonia app.

Add this code to the main window:

<Window.Styles> 
    <Style Selector=":is(Control)"> 
      <Setter Property="FocusAdorner"> 
        <FocusAdornerTemplate> 
          <Rectangle Stroke="Red" 
                     StrokeThickness="1"/> 
        </FocusAdornerTemplate> 
      </Setter> 
    </Style> 
  </Window.Styles>

Show red adorner when window got focus;

kekekeks commented 2 years ago

Adorners rendered in a special adorner layer that lives inside of the Window's template. So I believe adorners for the Window itself can't work with the current design.