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> <ResourceDictionary.MergedDictionaries>
<!-- Include the MUX Controls resources --> <!-- Include the MUX Controls resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
ControlsResourcesVersion="Version1" /> ControlsResourcesVersion="Version2" />
<ResourceDictionary> <ResourceDictionary>
<!-- <!--

View file

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

View file

@ -38,19 +38,35 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="local:SettingContainer"> <ControlTemplate TargetType="local:SettingContainer">
<StackPanel> <StackPanel>
<Grid Height="60"
<!-- Header space --> HorizontalAlignment="Stretch"
<StackPanel Style="{StaticResource SettingContainerHeaderStyle}"> Margin="16"
<TextBlock Text="{TemplateBinding Header}" /> CornerRadius="4"
<Button x:Name="ResetButton" Background="{ThemeResource SystemChromeMediumLowColor}">
Style="{StaticResource SettingContainerResetButtonStyle}"> <Grid.ColumnDefinitions>
<FontIcon Glyph="&#xE845;" <ColumnDefinition Width="50" />
Style="{StaticResource SettingContainerFontIconStyle}" /> <ColumnDefinition Width="*" />
</Button> <ColumnDefinition Width="*" />
</StackPanel> </Grid.ColumnDefinitions>
<FontIcon Grid.Column="0"
<!-- This is where the actual setting control will go --> Style="{StaticResource SettingContainerFontIconStyle}"
<ContentPresenter Content="{TemplateBinding Content}" /> 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> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>