■ Button 엘리먼트의 Template 속성을 사용하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<Button Width="150" Height="150"> <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid Margin="5"> <Ellipse Stroke="DarkBlue" StrokeThickness="2"> <Ellipse.Fill> <RadialGradientBrush Center="0.3,0.2" RadiusX="0.5" RadiusY="0.5"> <GradientStop Offset="0.1" Color="Azure" /> <GradientStop Offset="1.1" Color="CornflowerBlue" /> </RadialGradientBrush> </Ellipse.Fill> </Ellipse> <ContentPresenter Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> </ControlTemplate> </Button.Template> <Button.Content> Click Me! </Button.Content> </Button> |