use style xaml
This commit is contained in:
28
PacticeSolution/UseStyleOfWPF/MainWindow.xaml
Normal file
28
PacticeSolution/UseStyleOfWPF/MainWindow.xaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<Window x:Class="UseStyleOfWPF.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:UseStyleOfWPF"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="500">
|
||||
<Window.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="CornflowerBlue"/>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock FontWeight="Bold" FontSize="15"
|
||||
Text="This is text block without style option."/>
|
||||
<TextBlock Style="{StaticResource styTextBlock}"
|
||||
Text="This is text block with style option."/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Style="{StaticResource styOkButton}"
|
||||
Content="This is OK button"/>
|
||||
<Button Style="{StaticResource styCancelButton}"
|
||||
Content="This is Cancel button"/>
|
||||
</StackPanel>
|
||||
</Window>
|
Reference in New Issue
Block a user