Thursday, 21 November 2013

XAML CODE How to design Play Button in WPF-----------Mainwindow.xaml

 <Grid>
        <StackPanel>
            <StackPanel.Resources>
                <Style TargetType="{x:Type Button}" x:Key="Play">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type Button}" >
                                <Grid>
                                    <Ellipse Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Fill="LightGray" Stroke="Gray" VerticalAlignment="Top" HorizontalAlignment="Left"></Ellipse>
                                    <Polygon Points="18,12 18,35 38, 26" Fill="Black"></Polygon>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </StackPanel.Resources>
            <Button Height="50" Width="50" Style="{StaticResource Play}" >
                <StackPanel>
                  
                    <TextBlock>Play</TextBlock>
                    <Polygon HorizontalAlignment="Center" Fill="Black" Points="0,0 0,26 17,13"></Polygon>
                </StackPanel>
               
            </Button>
        </StackPanel>
       
    </Grid>

OUTPUT:

No comments:

Post a Comment