Created
February 3, 2013 17:48
-
-
Save mathieubrun/4702790 to your computer and use it in GitHub Desktop.
Inherit WPF styles, longer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | |
<StackPanel> | |
<StackPanel.Resources> | |
<Style TargetType="TextBlock" x:Key="DefaultTextBlock"> | |
<Setter Property="Background" Value="Red" /> | |
</Style> | |
<Style TargetType="TextBlock" | |
BasedOn="{StaticResource DefaultTextBlock}"> | |
</Style> | |
<Style TargetType="TextBlock" x:Key="Custom1"> | |
<Setter Property="Foreground" Value="Blue" /> | |
</Style> | |
<Style TargetType="TextBlock" x:Key="Custom2" | |
BasedOn="{StaticResource DefaultTextBlock}"> | |
<Setter Property="Foreground" Value="Blue" /> | |
</Style> | |
</StackPanel.Resources> | |
<TextBlock>Defaut</TextBlock> | |
<TextBlock Style="{StaticResource Custom1}">Custom 1 : background remis par defaut</TextBlock> | |
<TextBlock Style="{StaticResource Custom2}">Custom 2 : background repris de Default</TextBlock> | |
</StackPanel> | |
</Page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment