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

Set control adorner from xaml in Avalonia

License

Notifications You must be signed in to change notification settings

wieslawsoltes/XamlAdorner

Repository files navigation

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>