Skip to content

Commit 0c13c07

Browse files
committed
Create Grid Background
1 parent 9ff4235 commit 0c13c07

File tree

8 files changed

+48
-2
lines changed

8 files changed

+48
-2
lines changed

src/WPFDevelopers.Net40/Themes/Generic.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
<Setter Property="Template">
2828
<Setter.Value>
2929
<ControlTemplate TargetType="{x:Type wd:Window}">
30+
<ControlTemplate.Resources>
31+
<Style TargetType="Grid">
32+
<Setter Property="Background" Value="Transparent" />
33+
</Style>
34+
</ControlTemplate.Resources>
3035
<Border
3136
Name="PART_Border"
3237
Background="{TemplateBinding Background}"

src/WPFDevelopers.Net40/Themes/Theme.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@
699699
<Setter Property="Template">
700700
<Setter.Value>
701701
<ControlTemplate TargetType="{x:Type wd:Window}">
702+
<ControlTemplate.Resources>
703+
<Style TargetType="Grid">
704+
<Setter Property="Background" Value="Transparent" />
705+
</Style>
706+
</ControlTemplate.Resources>
702707
<Border Name="PART_Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
703708
<Grid x:Name="LayoutRoot">
704709
<Grid.RowDefinitions>
@@ -3830,6 +3835,10 @@
38303835
</Setter>
38313836
</Style>
38323837
<Style BasedOn="{StaticResource WD.DefaultRepeatButton}" TargetType="{x:Type RepeatButton}" />
3838+
<Style x:Key="WD.DefaultGrid" TargetType="{x:Type Grid}">
3839+
<Setter Property="Background" Value="{DynamicResource WD.BackgroundBrush}" />
3840+
</Style>
3841+
<Style BasedOn="{StaticResource WD.DefaultGrid}" TargetType="{x:Type Grid}" />
38333842
<Style TargetType="{x:Type ec:PathListBox}" x:Key="{x:Type ec:PathListBox}">
38343843
<Setter Property="IsTabStop" Value="False" />
38353844
<Setter Property="FrameworkElement.UseLayoutRounding" Value="False" />

src/WPFDevelopers.Net45x/Themes/Generic.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<Setter Property="Template">
3333
<Setter.Value>
3434
<ControlTemplate TargetType="{x:Type wd:Window}">
35+
<ControlTemplate.Resources>
36+
<Style TargetType="Grid">
37+
<Setter Property="Background" Value="Transparent" />
38+
</Style>
39+
</ControlTemplate.Resources>
3540
<Border
3641
Name="PART_Border"
3742
Background="{TemplateBinding Background}"

src/WPFDevelopers.Net45x/Themes/Theme.xaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@
699699
<Setter Property="Template">
700700
<Setter.Value>
701701
<ControlTemplate TargetType="{x:Type wd:Window}">
702+
<ControlTemplate.Resources>
703+
<Style TargetType="Grid">
704+
<Setter Property="Background" Value="Transparent" />
705+
</Style>
706+
</ControlTemplate.Resources>
702707
<Border Name="PART_Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
703708
<Grid x:Name="LayoutRoot">
704709
<Grid.RowDefinitions>
@@ -3858,6 +3863,10 @@
38583863
</Setter>
38593864
</Style>
38603865
<Style BasedOn="{StaticResource WD.DefaultRepeatButton}" TargetType="{x:Type RepeatButton}" />
3866+
<Style x:Key="WD.DefaultGrid" TargetType="{x:Type Grid}">
3867+
<Setter Property="Background" Value="{DynamicResource WD.BackgroundBrush}" />
3868+
</Style>
3869+
<Style BasedOn="{StaticResource WD.DefaultGrid}" TargetType="{x:Type Grid}" />
38613870
<Style TargetType="{x:Type ec:PathListBox}" x:Key="{x:Type ec:PathListBox}">
38623871
<Setter Property="IsTabStop" Value="False" />
38633872
<Setter Property="FrameworkElement.UseLayoutRounding" Value="False" />
@@ -6572,8 +6581,8 @@
65726581
<Style BasedOn="{StaticResource WD.Tag}" TargetType="{x:Type controls:Tag}" />
65736582
<DataTemplate x:Key="WD.NavScrollPanelTemplate">
65746583
<StackPanel Margin="0,0,0,20">
6575-
<TextBlock Margin="0,0,0,20" FontSize="{DynamicResource WD.TitleFontSize}" Text="{Binding Title}" />
6576-
<Border Padding="20" Background="{DynamicResource WD.BaseBrush}" CornerRadius="{Binding Path=(helpers:ElementHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=controls:NavScrollPanel}}">
6584+
<TextBlock Margin="0,0,0,20" FontSize="{DynamicResource WD.TitleFontSize}" FontWeight="Black" Text="{Binding Title}" />
6585+
<Border Padding="20" BorderBrush="{DynamicResource WD.BaseBrush}" BorderThickness="1" CornerRadius="{Binding Path=(helpers:ElementHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=controls:NavScrollPanel}}">
65776586
<ContentPresenter Content="{Binding Content}" />
65786587
</Border>
65796588
</StackPanel>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<ResourceDictionary
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:sys="clr-namespace:System;assembly=mscorlib">
5+
<ResourceDictionary.MergedDictionaries>
6+
<ResourceDictionary Source="../Themes/Basic/Colors.xaml" />
7+
</ResourceDictionary.MergedDictionaries>
8+
<Style x:Key="WD.DefaultGrid" TargetType="{x:Type Grid}">
9+
<Setter Property="Background" Value="{DynamicResource WD.BackgroundBrush}" />
10+
</Style>
11+
<Style BasedOn="{StaticResource WD.DefaultGrid}" TargetType="{x:Type Grid}" />
12+
</ResourceDictionary>

src/WPFDevelopers.Shared/Themes/Theme40.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Basic\ControlBasic.xaml
3333
..\Styles\Styles.GridSplitter.xaml
3434
..\Styles\Styles.Label.xaml
3535
..\Styles\Styles.RepeatButton.xaml
36+
..\Styles\Styles.Grid.xaml
3637

3738
..\Microsoft.Expression.Controls\Themes\Generic.xaml
3839
..\Microsoft.Expression.Drawing\Themes\Generic.xaml

src/WPFDevelopers.Shared/Themes/Theme45x.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Basic\ControlBasic.xaml
3333
..\Styles\Styles.GridSplitter.xaml
3434
..\Styles\Styles.Label.xaml
3535
..\Styles\Styles.RepeatButton.xaml
36+
..\Styles\Styles.Grid.xaml
3637

3738
..\Microsoft.Expression.Controls\Themes\Generic.xaml
3839
..\Microsoft.Expression.Drawing\Themes\Generic.xaml

src/WPFDevelopers.Shared/WPFDevelopers.Shared.projitems

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@
321321
<Generator>MSBuild:Compile</Generator>
322322
<SubType>Designer</SubType>
323323
</Page>
324+
<Page Include="$(MSBuildThisFileDirectory)Styles\Styles.Grid.xaml">
325+
<Generator>MSBuild:Compile</Generator>
326+
<SubType>Designer</SubType>
327+
</Page>
324328
<Page Include="$(MSBuildThisFileDirectory)Styles\Styles.GridSplitter.xaml">
325329
<Generator>MSBuild:Compile</Generator>
326330
<SubType>Designer</SubType>

0 commit comments

Comments
 (0)