daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Sep 22nd, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300">
  2.     <Window.Styles>
  3.         <Style Selector="Button.circle">
  4.             <Setter Property="Button.Template">
  5.                 <Setter.Value>
  6.                         <ControlTemplate>
  7.                             <Grid>
  8.                                 <Grid.Styles>
  9.                                 </Grid.Styles>
  10.                                 <Ellipse Name="Ellipse" Stroke="Black" StrokeThickness="2">
  11.                                    
  12.                                 </Ellipse>
  13.                                 <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"  Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
  14.                             </Grid>
  15.                         </ControlTemplate>
  16.                 </Setter.Value>
  17.             </Setter>
  18.         </Style>
  19.         <Style Selector="Button.circle /template/ Ellipse">
  20.             <Setter Property="Fill" Value="Red"/>
  21.         </Style>
  22.         <Style Selector="Button.circle:pointerover /template/ Ellipse">
  23.             <Setter Property="Fill" Value="Green"/>
  24.         </Style>
  25.         <Style Selector="Button.circle:pressed  /template/ Ellipse">
  26.             <Setter Property="Fill" Value="Blue"/>
  27.         </Style>
  28.         <Style Selector="Button.circle:pressed  /template/ ContentPresenter">
  29.             <Setter Property="Background" Value="Blue"/>
  30.         </Style>
  31.     </Window.Styles>
  32.         <Button Width="100" Height="100" Classes="circle">I'm a button</Button>
  33. </Window>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top