-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMainWindow.xaml
36 lines (34 loc) · 2.26 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<Window x:Class="AreaDesignWpfControls.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:local="clr-namespace:AreaDesignWpfControls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow" Width="800" Height="450" WindowStartupLocation="CenterScreen" mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ToggleButtonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource ToggleButtonSwitchStyle}" TargetType="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Margin" Value="3" />
</Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid x:Name="grid" Background="{DynamicResource BackgroundBrush}">
<ToggleButton x:Name="toggleButton" Height="110" Margin="100,0,0,0" HorizontalAlignment="Center"
local:ToggleButtonAttach.IsAutoFold="{Binding IsChecked, ElementName=checkBox}"
Checked="ToggleButton_Checked" Content="切换深色" FontSize="36"
Style="{StaticResource ToggleButtonGorgeousThemeSwitchStyle}"
Unchecked="ToggleButton_Checked" />
<StackPanel Margin="20" HorizontalAlignment="Left" VerticalAlignment="Top">
<TextBlock FontSize="24" Text="设置" ToolTip="使用示例" />
<CheckBox Name="checkBox" Content="自动折叠按钮" />
<CheckBox Margin="3" Content="切换主题"
IsChecked="{Binding IsChecked, ElementName=toggleButton}"
Style="{StaticResource ToggleButtonGorgeousThemeSwitchStyle}" />
</StackPanel>
<TextBlock x:Name="FpsTextBlock" Margin="15" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="18" />
</Grid>
</Window>