This commit is contained in:
Pankaj Bhojwani 2021-11-02 10:59:52 -07:00
parent 756fd444b1
commit 0b58355ef4
3 changed files with 32 additions and 16 deletions

View file

@ -21,7 +21,7 @@
<ResourceDictionary.MergedDictionaries>
<!-- Include the MUX Controls resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
ControlsResourcesVersion="Version1" />
ControlsResourcesVersion="Version2" />
<ResourceDictionary>
<!--

View file

@ -48,14 +48,14 @@
<!-- Used to stack a group of settings -->
<Style x:Key="SettingsStackStyle"
TargetType="StackPanel">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Margin" Value="13,0,0,48" />
</Style>
<!-- Used to stack a group of settings inside a pivot -->
<Style x:Key="PivotStackStyle"
TargetType="StackPanel">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Margin" Value="0,0,0,48" />
</Style>

View file

@ -38,19 +38,35 @@
<Setter.Value>
<ControlTemplate TargetType="local:SettingContainer">
<StackPanel>
<!-- Header space -->
<StackPanel Style="{StaticResource SettingContainerHeaderStyle}">
<TextBlock Text="{TemplateBinding Header}" />
<Button x:Name="ResetButton"
Style="{StaticResource SettingContainerResetButtonStyle}">
<FontIcon Glyph="&#xE845;"
Style="{StaticResource SettingContainerFontIconStyle}" />
</Button>
</StackPanel>
<!-- This is where the actual setting control will go -->
<ContentPresenter Content="{TemplateBinding Content}" />
<Grid Height="60"
HorizontalAlignment="Stretch"
Margin="16"
CornerRadius="4"
Background="{ThemeResource SystemChromeMediumLowColor}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
Style="{StaticResource SettingContainerFontIconStyle}"
Glyph="&#xE710;" />
<StackPanel Grid.Column="1"
Orientation="Vertical"
VerticalAlignment="Center">
<TextBlock Text="{TemplateBinding Header}"
FontSize="16"/>
<TextBlock Text="{TemplateBinding HelpText}"
FontSize="14"
Foreground="{ThemeResource SystemBaseMediumColor}"/>
</StackPanel>
<ContentPresenter Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="8"
BorderBrush="Transparent"
Content="{TemplateBinding Content}"/>
</Grid>
</StackPanel>
</ControlTemplate>
</Setter.Value>