Skip to content

Instantly share code, notes, and snippets.

@mterwoord
Created August 16, 2017 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mterwoord/ad36da9854701cb5adfb592db7a3eb83 to your computer and use it in GitHub Desktop.
Save mterwoord/ad36da9854701cb5adfb592db7a3eb83 to your computer and use it in GitHub Desktop.
Button sample
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Style Selector="Button.Round">
<Setter Property="Template">
<ControlTemplate>
<Border CornerRadius="8" Background="{TemplateBinding Background}">
<ContentPresenter Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.Round:pressed">
<Setter Property="Template">
<ControlTemplate>
<Border Background="Red"
CornerRadius="8">
<ContentPresenter Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.Round:pointerover">
<Setter Property="Background" Value="Red"/>
</Style>
</Styles>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment