Created
May 7, 2019 06:13
-
-
Save EifelMono/a4863da5878e8b037666ae4f634c112f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<Grid> | |
<StackPanel> | |
<Button Margin="10" Width="100" Height="30" Content="Click Me" x:Name="btn"/> | |
<TextBlock Margin="10" Text="Hello, styled world!" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center"> | |
<TextBlock.Style> | |
<Style TargetType="TextBlock"> | |
<Setter Property="Foreground" Value="Blue"></Setter> | |
<Style.Triggers> | |
<Trigger Property="IsMouseOver" Value="True"> | |
<Setter Property="Foreground" Value="Red" /> | |
<Setter Property="TextDecorations" Value="Underline" /> | |
</Trigger> | |
</Style.Triggers> | |
</Style> | |
</TextBlock.Style> | |
</TextBlock> | |
<CheckBox Margin="10" Name="cbSample" Content="Hello, world?" /> | |
<TextBlock Margin="10" HorizontalAlignment="Center" FontSize="48"> | |
<TextBlock.Style> | |
<Style TargetType="TextBlock"> | |
<Setter Property="Text" Value="No" /> | |
<Setter Property="Foreground" Value="Red" /> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding ElementName=cbSample, Path=IsChecked}" Value="True"> | |
<Setter Property="Text" Value="Yes!" /> | |
<Setter Property="Foreground" Value="Green" /> | |
</DataTrigger> | |
</Style.Triggers> | |
</Style> | |
</TextBlock.Style> | |
</TextBlock> | |
</StackPanel> | |
</Grid> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment