Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Latest commit

 

History

History
31 lines (26 loc) · 1.16 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.16 KB

XamlAdorner

NuGet NuGet

Set control adorner from xaml in Avalonia

Usage

<Button Content="Adorned Button" 
        HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
        VerticalContentAlignment="Center" VerticalAlignment="Stretch" 
        Width="200" Height="42">
  <XamlAdornerLayer.Adorner>
    <Canvas x:Name="AdornerCanvas"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Background="Cyan"
            IsHitTestVisible="False"
            Opacity="0.3"
            IsVisible="True">
      <Line StartPoint="-10000,0" EndPoint="10000,0" Stroke="Cyan" StrokeThickness="1" />
      <Line StartPoint="-10000,42" EndPoint="10000,42" Stroke="Cyan" StrokeThickness="1" />
      <Line StartPoint="0,-10000" EndPoint="0,10000" Stroke="Cyan" StrokeThickness="1" />
      <Line StartPoint="200,-10000" EndPoint="200,10000" Stroke="Cyan" StrokeThickness="1" />
    </Canvas>
  </XamlAdornerLayer.Adorner>
</Button>