4 changed files with 124 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
<UserControl x:Class="ControlCatalog.Pages.AdornerLayerPage" |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
d:DesignHeight="800" |
|||
d:DesignWidth="400" |
|||
mc:Ignorable="d"> |
|||
<Grid RowDefinitions="100,42,*" ColumnDefinitions="50,200,*"> |
|||
<Button Content="Adorned Button" |
|||
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" |
|||
VerticalContentAlignment="Center" VerticalAlignment="Stretch" |
|||
Grid.Row="1" Grid.Column="1"> |
|||
<AdornerLayer.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> |
|||
</AdornerLayer.Adorner> |
|||
</Button> |
|||
</Grid> |
|||
</UserControl> |
|||
@ -0,0 +1,19 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
|
|||
namespace ControlCatalog.Pages |
|||
{ |
|||
public class AdornerLayerPage : UserControl |
|||
{ |
|||
public AdornerLayerPage() |
|||
{ |
|||
this.InitializeComponent(); |
|||
} |
|||
|
|||
private void InitializeComponent() |
|||
{ |
|||
AvaloniaXamlLoader.Load(this); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue