Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300">
- <Window.Styles>
- <Style Selector="Button.circle">
- <Setter Property="Button.Template">
- <Setter.Value>
- <ControlTemplate>
- <Grid>
- <Grid.Styles>
- </Grid.Styles>
- <Ellipse Name="Ellipse" Stroke="Black" StrokeThickness="2">
- </Ellipse>
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style Selector="Button.circle /template/ Ellipse">
- <Setter Property="Fill" Value="Red"/>
- </Style>
- <Style Selector="Button.circle:pointerover /template/ Ellipse">
- <Setter Property="Fill" Value="Green"/>
- </Style>
- <Style Selector="Button.circle:pressed /template/ Ellipse">
- <Setter Property="Fill" Value="Blue"/>
- </Style>
- <Style Selector="Button.circle:pressed /template/ ContentPresenter">
- <Setter Property="Background" Value="Blue"/>
- </Style>
- </Window.Styles>
- <Button Width="100" Height="100" Classes="circle">I'm a button</Button>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement