-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds style for GroupBox in fluent (#10504)
* Adding style for GroupBox in fluent and also adding corresponding control and fluent brushes for the same * Makes padding a StaticResource * Addressing PR comments * Addressing PR comments 2.0 * Adds reference for GroupBox.xaml in Fluent.xaml * Updated value of BorderThickness * Makes DynamicResource binding of GroupBoxHeaderForeground * Replacing Foreground with TextElement.Foreground in ContentPresenter * Removing extra brush from HC.xaml
- Loading branch information
1 parent
575fdc7
commit d17c36a
Showing
8 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
51 changes: 51 additions & 0 deletions
51
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/GroupBox.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:system="clr-namespace:System;assembly=System.Runtime"> | ||
|
||
<Thickness x:Key="GroupBoxPadding">0,0,0,16</Thickness> | ||
<system:Double x:Key="GroupBoxHeaderFontSize">20</system:Double> | ||
<Thickness x:Key="GroupBoxHeaderMargin">0,4,0,12</Thickness> | ||
<Thickness x:Key="GroupBoxBorderThickness">0</Thickness> | ||
|
||
<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}"> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" /> | ||
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" /> | ||
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" /> | ||
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type GroupBox}"> | ||
<Border | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
Background="{TemplateBinding Background}" | ||
SnapsToDevicePixels="True"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<ContentPresenter | ||
Grid.Row="0" | ||
TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}" | ||
Margin="{DynamicResource GroupBoxHeaderMargin}" | ||
ContentSource="Header" | ||
TextElement.Foreground="{DynamicResource GroupBoxHeaderForeground}" | ||
RecognizesAccessKey="True" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||
<ContentPresenter | ||
Grid.Row="1" | ||
Margin="{TemplateBinding Padding}" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||
</Grid> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style BasedOn="{StaticResource DefaultGroupBoxStyle}" TargetType="{x:Type GroupBox}" /> | ||
|
||
</ResourceDictionary> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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