|
1 |
| -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 |
| - xmlns:wpfdev="clr-namespace:WPFDevelopers.Net45x" |
4 |
| - xmlns:converts="clr-namespace:WPFDevelopers.Converts"> |
5 |
| - |
6 |
| - |
7 |
| - <converts:ObjectNullToVisibilityConverter x:Key="ObjectNullToVisibilityConverter"/> |
8 |
| - <Style x:Key="WPFDevelopersWindow" TargetType="{x:Type wpfdev:Window}" BasedOn="{x:Null}"> |
| 1 | +<ResourceDictionary |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:converts="clr-namespace:WPFDevelopers.Converts" |
| 5 | + xmlns:wpfdev="clr-namespace:WPFDevelopers.Net45x"> |
| 6 | + <converts:ObjectNullToVisibilityConverter x:Key="ObjectNullToVisibilityConverter" /> |
| 7 | + <Style |
| 8 | + x:Key="WPFDevelopersWindow" |
| 9 | + BasedOn="{x:Null}" |
| 10 | + TargetType="{x:Type wpfdev:Window}"> |
9 | 11 | <Setter Property="Foreground" Value="{DynamicResource WD.WindowForegroundColorBrush}" />
|
10 |
| - <Setter Property="Background" Value="{DynamicResource WD.BackgroundSolidColorBrush}" /> |
| 12 | + <Setter Property="Background" Value="{DynamicResource WD.BackgroundSolidColorBrush}" /> |
11 | 13 | <Setter Property="BorderBrush" Value="{DynamicResource WD.WindowBorderBrushSolidColorBrush}" />
|
12 |
| - <Setter Property="BorderThickness" Value="1"/> |
13 |
| - <Setter Property="IsTabStop" Value="False" /> |
14 |
| - <!--<Setter Property="ResizeMode" Value="CanResizeWithGrip" />--> |
15 |
| - <Setter Property="SnapsToDevicePixels" Value="True"/> |
| 14 | + <Setter Property="BorderThickness" Value="1" /> |
| 15 | + <Setter Property="IsTabStop" Value="False" /> |
| 16 | + <Setter Property="SnapsToDevicePixels" Value="True" /> |
16 | 17 | <Setter Property="UseLayoutRounding" Value="True" />
|
17 | 18 | <Setter Property="TextOptions.TextFormattingMode" Value="Ideal" />
|
18 |
| - <Setter Property="WindowStyle" Value="None" /> |
19 |
| - <Setter Property="MaxHeight" Value="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}"/> |
20 |
| - <Setter Property="MaxWidth" Value="{x:Static SystemParameters.MaximizedPrimaryScreenWidth}"/> |
| 19 | + <Setter Property="WindowStyle" Value="None" /> |
| 20 | + <Setter Property="MaxHeight" Value="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}" /> |
| 21 | + <Setter Property="MaxWidth" Value="{x:Static SystemParameters.MaximizedPrimaryScreenWidth}" /> |
21 | 22 | <Setter Property="FontFamily" Value="{DynamicResource WD.NormalFontFamily}" />
|
22 | 23 | <Setter Property="WindowChrome.WindowChrome">
|
23 | 24 | <Setter.Value>
|
24 |
| - <WindowChrome GlassFrameThickness="0,0,0,.1" |
25 |
| - UseAeroCaptionButtons="False" |
26 |
| - CaptionHeight="{Binding TitleHeight,RelativeSource={RelativeSource AncestorType=wpfdev:Window}}"/> |
| 25 | + <WindowChrome |
| 26 | + CaptionHeight="{Binding TitleHeight, RelativeSource={RelativeSource AncestorType=wpfdev:Window}}" |
| 27 | + GlassFrameThickness="0,0,0,.1" |
| 28 | + UseAeroCaptionButtons="False" /> |
27 | 29 | </Setter.Value>
|
28 | 30 | </Setter>
|
29 | 31 | <Setter Property="Template">
|
30 | 32 | <Setter.Value>
|
31 | 33 | <ControlTemplate TargetType="{x:Type wpfdev:Window}">
|
32 |
| - <Border SnapsToDevicePixels="True" |
33 |
| - BorderBrush="{TemplateBinding BorderBrush}" |
34 |
| - BorderThickness="{TemplateBinding BorderThickness}"> |
35 |
| - <Grid Background="{TemplateBinding Background}" |
36 |
| - x:Name="LayoutRoot"> |
| 34 | + <Border |
| 35 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 36 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 37 | + SnapsToDevicePixels="True"> |
| 38 | + <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}"> |
37 | 39 | <Grid.RowDefinitions>
|
38 | 40 | <RowDefinition Height="Auto" />
|
39 | 41 | <RowDefinition Height="*" />
|
40 | 42 | </Grid.RowDefinitions>
|
41 |
| - <Grid Grid.Row="0" Height="{TemplateBinding TitleHeight}" |
42 |
| - Background="{TemplateBinding BorderBrush}"> |
| 43 | + <Grid |
| 44 | + Grid.Row="0" |
| 45 | + Height="{TemplateBinding TitleHeight}" |
| 46 | + Background="{TemplateBinding BorderBrush}"> |
43 | 47 | <Grid.ColumnDefinitions>
|
44 | 48 | <ColumnDefinition Width="Auto" />
|
45 | 49 | <ColumnDefinition Width="*" />
|
46 |
| - <ColumnDefinition Width="Auto" MinWidth="30"/> |
| 50 | + <ColumnDefinition Width="Auto" MinWidth="30" /> |
47 | 51 | </Grid.ColumnDefinitions>
|
48 |
| - <Image Source="{TemplateBinding Icon}" Stretch="Fill" |
49 |
| - VerticalAlignment="Center" HorizontalAlignment="Left" Width="30" Height="30" Margin="14,0,0,0" |
| 52 | + <Image |
| 53 | + Width="30" |
| 54 | + Height="30" |
| 55 | + Margin="14,0,0,0" |
| 56 | + HorizontalAlignment="Left" |
| 57 | + VerticalAlignment="Center" |
50 | 58 | RenderOptions.BitmapScalingMode="HighQuality"
|
51 |
| - Visibility="{TemplateBinding Icon,Converter={StaticResource ObjectNullToVisibilityConverter}}"/> |
52 |
| - <TextBlock Text="{TemplateBinding Title}" x:Name="PART_Title" Margin="6,0" |
53 |
| - Foreground="{TemplateBinding Foreground}" Grid.Column="1" |
54 |
| - VerticalAlignment="Center" FontSize="{DynamicResource WD.TitleFontSize}"/> |
55 |
| - <WrapPanel Grid.Column="2" WindowChrome.IsHitTestVisibleInChrome="True" |
56 |
| - Margin="0,6"> |
| 59 | + Source="{TemplateBinding Icon}" |
| 60 | + Stretch="Fill" |
| 61 | + Visibility="{TemplateBinding Icon, |
| 62 | + Converter={StaticResource ObjectNullToVisibilityConverter}}" /> |
| 63 | + <TextBlock |
| 64 | + x:Name="PART_Title" |
| 65 | + Grid.Column="1" |
| 66 | + Margin="6,0" |
| 67 | + VerticalAlignment="Center" |
| 68 | + FontSize="{DynamicResource WD.TitleFontSize}" |
| 69 | + Foreground="{TemplateBinding Foreground}" |
| 70 | + Text="{TemplateBinding Title}" /> |
| 71 | + <WrapPanel |
| 72 | + Grid.Column="2" |
| 73 | + Margin="0,6" |
| 74 | + WindowChrome.IsHitTestVisibleInChrome="True"> |
57 | 75 | <WrapPanel x:Name="PART_MinAndMax">
|
58 |
| - <Button Name="PART_MinimizeButton" IsTabStop="False" Padding="0" |
59 |
| - Style="{DynamicResource WD.WindowButtonStyle}" |
60 |
| - Command="SystemCommands.MinimizeWindowCommand"> |
| 76 | + <Button |
| 77 | + Name="PART_MinimizeButton" |
| 78 | + Padding="0" |
| 79 | + Command="SystemCommands.MinimizeWindowCommand" |
| 80 | + IsTabStop="False" |
| 81 | + Style="{DynamicResource WD.WindowButtonStyle}"> |
61 | 82 | <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
62 |
| - <Rectangle x:Name="MinimizeGlyph" Width="10" Height="1" Margin="0 7 0 0" |
63 |
| - VerticalAlignment="Bottom" Fill="{TemplateBinding Foreground}" /> |
| 83 | + <Rectangle |
| 84 | + x:Name="MinimizeGlyph" |
| 85 | + Width="10" |
| 86 | + Height="1" |
| 87 | + Margin="0,7,0,0" |
| 88 | + VerticalAlignment="Bottom" |
| 89 | + Fill="{TemplateBinding Foreground}" /> |
64 | 90 | </Grid>
|
65 | 91 | </Button>
|
66 |
| - <Button Name="PART_MaximizeButton" IsTabStop="False" Padding="0" |
67 |
| - Style="{DynamicResource WD.WindowButtonStyle}" |
68 |
| - Command="SystemCommands.MaximizeWindowCommand"> |
| 92 | + <Button |
| 93 | + Name="PART_MaximizeButton" |
| 94 | + Padding="0" |
| 95 | + Command="SystemCommands.MaximizeWindowCommand" |
| 96 | + IsTabStop="False" |
| 97 | + Style="{DynamicResource WD.WindowButtonStyle}"> |
69 | 98 | <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
70 |
| - <Path Width="10" Height="10" |
71 |
| - HorizontalAlignment="Center" VerticalAlignment="Center" |
72 |
| - Data="{DynamicResource WD.WindowMaximizeGeometry}" Fill="{TemplateBinding Foreground}" |
73 |
| - Stretch="Fill" UseLayoutRounding="False" /> |
| 99 | + <Path |
| 100 | + Width="10" |
| 101 | + Height="10" |
| 102 | + HorizontalAlignment="Center" |
| 103 | + VerticalAlignment="Center" |
| 104 | + Data="{DynamicResource WD.WindowMaximizeGeometry}" |
| 105 | + Fill="{TemplateBinding Foreground}" |
| 106 | + Stretch="Fill" |
| 107 | + UseLayoutRounding="False" /> |
74 | 108 | </Grid>
|
75 | 109 | </Button>
|
76 |
| - <Button Name="PART_RestoreButton" IsTabStop="False" Padding="0" |
77 |
| - Style="{DynamicResource WD.WindowButtonStyle}" |
| 110 | + <Button |
| 111 | + Name="PART_RestoreButton" |
| 112 | + Padding="0" |
78 | 113 | Command="SystemCommands.RestoreWindowCommand"
|
| 114 | + IsTabStop="False" |
| 115 | + Style="{DynamicResource WD.WindowButtonStyle}" |
79 | 116 | Visibility="Collapsed">
|
80 | 117 | <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
81 |
| - <Path Width="10" Height="10" |
82 |
| - HorizontalAlignment="Center" VerticalAlignment="Center" |
83 |
| - Data="{DynamicResource WD.WindowRestoreGeometry}" Fill="{TemplateBinding Foreground}" |
84 |
| - Stretch="Fill" UseLayoutRounding="False" /> |
| 118 | + <Path |
| 119 | + Width="10" |
| 120 | + Height="10" |
| 121 | + HorizontalAlignment="Center" |
| 122 | + VerticalAlignment="Center" |
| 123 | + Data="{DynamicResource WD.WindowRestoreGeometry}" |
| 124 | + Fill="{TemplateBinding Foreground}" |
| 125 | + Stretch="Fill" |
| 126 | + UseLayoutRounding="False" /> |
85 | 127 | </Grid>
|
86 | 128 | </Button>
|
87 | 129 | </WrapPanel>
|
88 | 130 |
|
89 |
| - <Button Name="PART_CloseButton" |
90 |
| - IsTabStop="False" Style="{DynamicResource WD.WindowButtonStyle}" |
91 |
| - Command="SystemCommands.CloseWindowCommand"> |
92 |
| - <Path Width="10" Height="10" |
93 |
| - HorizontalAlignment="Center" |
94 |
| - VerticalAlignment="Center" |
95 |
| - Data="{DynamicResource WD.WindowCloseGeometry}" |
96 |
| - Fill="{TemplateBinding Foreground}" |
97 |
| - Stretch="Fill" /> |
| 131 | + <Button |
| 132 | + Name="PART_CloseButton" |
| 133 | + Command="SystemCommands.CloseWindowCommand" |
| 134 | + IsTabStop="False" |
| 135 | + Style="{DynamicResource WD.WindowButtonStyle}"> |
| 136 | + <Path |
| 137 | + Width="10" |
| 138 | + Height="10" |
| 139 | + HorizontalAlignment="Center" |
| 140 | + VerticalAlignment="Center" |
| 141 | + Data="{DynamicResource WD.WindowCloseGeometry}" |
| 142 | + Fill="{TemplateBinding Foreground}" |
| 143 | + Stretch="Fill" /> |
98 | 144 | </Button>
|
99 | 145 | </WrapPanel>
|
100 | 146 | </Grid>
|
101 | 147 | <AdornerDecorator Grid.Row="1" KeyboardNavigation.IsTabStop="False">
|
102 |
| - <ContentPresenter x:Name="MainContentPresenter" ClipToBounds="True"/> |
| 148 | + <ContentPresenter x:Name="MainContentPresenter" ClipToBounds="True" /> |
103 | 149 | </AdornerDecorator>
|
104 |
| - <ResizeGrip x:Name="ResizeGrip" |
105 |
| - HorizontalAlignment="Right" |
106 |
| - VerticalAlignment="Bottom" |
107 |
| - Grid.Row="1" IsTabStop="False" |
108 |
| - Visibility="Collapsed"/> |
| 150 | + <ResizeGrip |
| 151 | + x:Name="ResizeGrip" |
| 152 | + Grid.Row="1" |
| 153 | + HorizontalAlignment="Right" |
| 154 | + VerticalAlignment="Bottom" |
| 155 | + IsTabStop="False" |
| 156 | + Visibility="Collapsed" /> |
109 | 157 | </Grid>
|
110 | 158 | </Border>
|
111 | 159 | <ControlTemplate.Triggers>
|
112 | 160 | <Trigger Property="WindowState" Value="Maximized">
|
113 |
| - <Setter Property="Visibility" Value="Visible" TargetName="PART_RestoreButton"/> |
114 |
| - <Setter Property="Visibility" Value="Collapsed" TargetName="PART_MaximizeButton"/> |
115 |
| - <Setter Property="Margin" TargetName="LayoutRoot" Value="7"/> |
| 161 | + <Setter TargetName="PART_RestoreButton" Property="Visibility" Value="Visible" /> |
| 162 | + <Setter TargetName="PART_MaximizeButton" Property="Visibility" Value="Collapsed" /> |
| 163 | + <Setter TargetName="LayoutRoot" Property="Margin" Value="7" /> |
116 | 164 | </Trigger>
|
117 | 165 | <Trigger Property="WindowStyle" Value="ToolWindow">
|
118 | 166 | <Setter TargetName="PART_MinAndMax" Property="Visibility" Value="Collapsed" />
|
119 | 167 | </Trigger>
|
120 | 168 | <MultiTrigger>
|
121 | 169 | <MultiTrigger.Conditions>
|
122 |
| - <Condition Property="ResizeMode" Value="CanResizeWithGrip" /> |
123 |
| - <Condition Property="WindowState" Value="Normal" /> |
| 170 | + <Condition Property="ResizeMode" Value="CanResizeWithGrip" /> |
| 171 | + <Condition Property="WindowState" Value="Normal" /> |
124 | 172 | </MultiTrigger.Conditions>
|
125 | 173 | <Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
|
126 | 174 | </MultiTrigger>
|
127 |
| - <!--<MultiTrigger> |
128 |
| - <MultiTrigger.Conditions> |
129 |
| - <Condition Property="ResizeMode" Value="NoResize" /> |
130 |
| - <Condition Property="WindowStyle" Value="ToolWindow" /> |
131 |
| - </MultiTrigger.Conditions> |
132 |
| - <Setter TargetName="PART_MinAndMax" Property="Visibility" Value="Collapsed" /> |
133 |
| - </MultiTrigger>--> |
134 | 175 | </ControlTemplate.Triggers>
|
135 | 176 | </ControlTemplate>
|
136 | 177 | </Setter.Value>
|
|
0 commit comments