Using the Visual State Manager in Silverlight Templates: Listing 1

<Style x:Key="ButtonFlatStyle" TargetType="Button">
    <Setter Property="Width" Value="100" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">  
                <Grid>                      
                    <Border Width="{TemplateBinding Width}" 
                       Height="{TemplateBinding Height}"
                       Background="{TemplateBinding Background}" 
                       CornerRadius="8" BorderBrush="Black" 
                       BorderThickness="1">
                          <ContentPresenter 
                            Content="{TemplateBinding Content}" 
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center" />
                    </Border>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.