just use muxc:expander
This commit is contained in:
parent
f3fd85731d
commit
13bbcbf50f
|
@ -172,7 +172,7 @@
|
|||
ClearSettingValue="{x:Bind Appearance.ClearCursorShape}"
|
||||
HasSettingValue="{x:Bind Appearance.HasCursorShape, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Appearance.CursorShapeOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind CursorShapeList, Mode=OneWay}"
|
||||
|
@ -210,6 +210,8 @@
|
|||
<!-- Background Image -->
|
||||
<local:SettingContainer x:Name="BackgroundImageContainer"
|
||||
x:Uid="Profile_BackgroundImage"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind Appearance.BackgroundImagePath, Mode=OneWay}"
|
||||
ClearSettingValue="{x:Bind Appearance.ClearBackgroundImagePath}"
|
||||
HasSettingValue="{x:Bind Appearance.HasBackgroundImagePath, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Appearance.BackgroundImagePathOverrideSource, Mode=OneWay}">
|
||||
|
@ -234,6 +236,7 @@
|
|||
<local:SettingContainer x:Uid="Profile_BackgroundImageStretchMode"
|
||||
ClearSettingValue="{x:Bind Appearance.ClearBackgroundImageStretchMode}"
|
||||
HasSettingValue="{x:Bind Appearance.HasBackgroundImageStretchMode, Mode=OneWay}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
SettingOverrideSource="{x:Bind Appearance.BackgroundImageStretchModeOverrideSource, Mode=OneWay}"
|
||||
Visibility="{x:Bind Appearance.BackgroundImageSettingsVisible, Mode=OneWay}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
|
@ -245,6 +248,7 @@
|
|||
<!-- Background Image Alignment -->
|
||||
<local:SettingContainer x:Uid="Profile_BackgroundImageAlignment"
|
||||
ClearSettingValue="{x:Bind Appearance.ClearBackgroundImageAlignment}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
HasSettingValue="{x:Bind Appearance.HasBackgroundImageAlignment, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Appearance.BackgroundImageAlignmentOverrideSource, Mode=OneWay}"
|
||||
Visibility="{x:Bind Appearance.BackgroundImageSettingsVisible, Mode=OneWay}">
|
||||
|
@ -451,7 +455,7 @@
|
|||
ClearSettingValue="{x:Bind Appearance.ClearIntenseTextStyle}"
|
||||
HasSettingValue="{x:Bind Appearance.HasIntenseTextStyle, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind Appearance.IntenseTextStyleOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind IntenseTextStyleList, Mode=OneWay}"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
<!-- Theme -->
|
||||
<local:SettingContainer x:Uid="Globals_Theme"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind ThemeList, Mode=OneWay}"
|
||||
|
@ -75,7 +75,7 @@
|
|||
|
||||
<!-- Tab Width Mode -->
|
||||
<local:SettingContainer x:Uid="Globals_TabWidthMode"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind TabWidthModeList, Mode=OneWay}"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
<!-- Copy Format -->
|
||||
<local:SettingContainer x:Uid="Globals_CopyFormat"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind CopyFormatList, Mode=OneWay}"
|
||||
|
@ -51,7 +51,9 @@
|
|||
</local:SettingContainer>
|
||||
|
||||
<!-- Word Delimiters -->
|
||||
<local:SettingContainer x:Uid="Globals_WordDelimiters">
|
||||
<local:SettingContainer x:Uid="Globals_WordDelimiters"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Globals.WordDelimiters, Mode=OneWay}">
|
||||
<TextBox IsSpellCheckEnabled="False"
|
||||
Style="{StaticResource TextBoxSettingStyle}"
|
||||
Text="{x:Bind State.Globals.WordDelimiters, Mode=TwoWay}" />
|
||||
|
@ -64,7 +66,7 @@
|
|||
|
||||
<!-- Tab Switcher Mode -->
|
||||
<local:SettingContainer x:Uid="Globals_TabSwitcherMode"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind TabSwitcherModeList}"
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
||||
<!-- Default Profile -->
|
||||
<local:SettingContainer x:Name="zzzknn"
|
||||
x:Uid="Globals_DefaultProfile">
|
||||
<local:SettingContainer x:Uid="Globals_DefaultProfile">
|
||||
<ComboBox x:Name="DefaultProfile"
|
||||
ItemsSource="{x:Bind DefaultProfiles}"
|
||||
SelectedItem="{x:Bind CurrentDefaultProfile, Mode=TwoWay}"
|
||||
|
@ -136,7 +135,7 @@
|
|||
<!-- First Window Behavior -->
|
||||
<local:SettingContainer x:Uid="Globals_FirstWindowPreference"
|
||||
Visibility="{x:Bind ShowFirstWindowPreference}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind FirstWindowPreferenceList}"
|
||||
|
@ -147,7 +146,7 @@
|
|||
<!-- Launch Mode -->
|
||||
<local:SettingContainer x:Name="Globals_LaunchMode"
|
||||
x:Uid="Globals_LaunchMode"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind LaunchModeList}"
|
||||
|
@ -156,7 +155,7 @@
|
|||
|
||||
<!-- Launch Mode -->
|
||||
<local:SettingContainer x:Uid="Globals_WindowingBehavior"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind WindowingBehaviorList}"
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
so the name will always be overridden.
|
||||
-->
|
||||
<local:SettingContainer x:Uid="Profile_Name"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Profile.Name, Mode=OneWay}"
|
||||
Visibility="{x:Bind local:Converters.InvertedBooleanToVisibility(State.Profile.IsBaseLayer), Mode=OneWay}">
|
||||
<TextBox Style="{StaticResource TextBoxSettingStyle}"
|
||||
Text="{x:Bind State.Profile.Name, Mode=TwoWay}" />
|
||||
|
@ -77,6 +79,8 @@
|
|||
ClearSettingValue="{x:Bind State.Profile.ClearCommandline}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasCommandline, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.CommandlineOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Profile.Commandline, Mode=OneWay}"
|
||||
Visibility="{x:Bind local:Converters.InvertedBooleanToVisibility(State.Profile.IsBaseLayer), Mode=OneWay}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox x:Uid="Profile_CommandlineBox"
|
||||
|
@ -92,6 +96,8 @@
|
|||
<!-- Starting Directory -->
|
||||
<local:SettingContainer x:Name="StartingDirectoryContainer"
|
||||
x:Uid="Profile_StartingDirectory"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Profile.StartingDirectory, Mode=OneWay}"
|
||||
ClearSettingValue="{x:Bind State.Profile.ClearStartingDirectory}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasStartingDirectory, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.StartingDirectoryOverrideSource, Mode=OneWay}">
|
||||
|
@ -118,6 +124,8 @@
|
|||
<local:SettingContainer x:Uid="Profile_Icon"
|
||||
ClearSettingValue="{x:Bind State.Profile.ClearIcon}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasIcon, Mode=OneWay}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Profile.Icon, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.IconOverrideSource, Mode=OneWay}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox x:Uid="Profile_IconBox"
|
||||
|
@ -134,6 +142,8 @@
|
|||
<!-- Tab Title -->
|
||||
<local:SettingContainer x:Uid="Profile_TabTitle"
|
||||
ClearSettingValue="{x:Bind State.Profile.ClearTabTitle}"
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}"
|
||||
CurrentValue="{x:Bind State.Profile.TabTitle, Mode=OneWay}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasTabTitle, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.TabTitleOverrideSource, Mode=OneWay}">
|
||||
<TextBox Style="{StaticResource TextBoxSettingStyle}"
|
||||
|
@ -305,7 +315,7 @@
|
|||
ClearSettingValue="{x:Bind State.Profile.ClearScrollState}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasScrollState, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.ScrollStateOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind ScrollStateList, Mode=OneWay}"
|
||||
|
@ -411,7 +421,7 @@
|
|||
ClearSettingValue="{x:Bind State.Profile.ClearAntialiasingMode}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasAntialiasingMode, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.AntialiasingModeOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind AntiAliasingModeList, Mode=OneWay}"
|
||||
|
@ -452,7 +462,7 @@
|
|||
ClearSettingValue="{x:Bind State.Profile.ClearCloseOnExit}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasCloseOnExit, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.CloseOnExitOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<muxc:RadioButtons AutomationProperties.AccessibilityView="Content"
|
||||
ItemTemplate="{StaticResource EnumRadioButtonTemplate}"
|
||||
ItemsSource="{x:Bind CloseOnExitModeList, Mode=OneWay}"
|
||||
|
@ -464,7 +474,7 @@
|
|||
ClearSettingValue="{x:Bind State.Profile.ClearBellStyle}"
|
||||
HasSettingValue="{x:Bind State.Profile.HasBellStyle, Mode=OneWay}"
|
||||
SettingOverrideSource="{x:Bind State.Profile.BellStyleOverrideSource, Mode=OneWay}"
|
||||
Style="{StaticResource AlternativeSettingContainerStyle}">
|
||||
Style="{StaticResource ExpanderSettingContainerStyle}">
|
||||
<StackPanel>
|
||||
<CheckBox x:Uid="Profile_BellStyleAudible"
|
||||
IsChecked="{x:Bind IsBellStyleFlagSet(1), BindBack=SetBellStyleAudible, Mode=TwoWay}" />
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
{
|
||||
DependencyProperty SettingContainer::_HeaderProperty{ nullptr };
|
||||
DependencyProperty SettingContainer::_HelpTextProperty{ nullptr };
|
||||
DependencyProperty SettingContainer::_CurrentValueProperty{ nullptr };
|
||||
DependencyProperty SettingContainer::_HasSettingValueProperty{ nullptr };
|
||||
DependencyProperty SettingContainer::_SettingOverrideSourceProperty{ nullptr };
|
||||
|
||||
|
@ -43,6 +44,15 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
xaml_typename<Editor::SettingContainer>(),
|
||||
PropertyMetadata{ box_value(L"") });
|
||||
}
|
||||
if (!_CurrentValueProperty)
|
||||
{
|
||||
_CurrentValueProperty =
|
||||
DependencyProperty::Register(
|
||||
L"CurrentValue",
|
||||
xaml_typename<hstring>(),
|
||||
xaml_typename<Editor::SettingContainer>(),
|
||||
PropertyMetadata{ box_value(L"") });
|
||||
}
|
||||
if (!_HasSettingValueProperty)
|
||||
{
|
||||
_HasSettingValueProperty =
|
||||
|
@ -72,23 +82,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
|
||||
void SettingContainer::OnApplyTemplate()
|
||||
{
|
||||
if (const auto& child{ GetTemplateChild(L"ExpanderButton") })
|
||||
{
|
||||
if (const auto& toggleButton{ child.try_as<Controls::Primitives::ToggleButton>() })
|
||||
{
|
||||
toggleButton.Click([=](auto&&, auto&&) {
|
||||
if (const auto& expanderChild{ GetTemplateChild(L"MainContentContainer") })
|
||||
{
|
||||
if (const auto& expander{ expanderChild.try_as<Controls::Border>() })
|
||||
{
|
||||
const auto newVisibility = expander.Visibility() == Visibility::Visible ? Visibility::Collapsed : Visibility::Visible;
|
||||
expander.Visibility(newVisibility);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (const auto& child{ GetTemplateChild(L"ResetButton") })
|
||||
{
|
||||
if (const auto& button{ child.try_as<Controls::Button>() })
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||
|
||||
DEPENDENCY_PROPERTY(Windows::Foundation::IInspectable, Header);
|
||||
DEPENDENCY_PROPERTY(hstring, HelpText);
|
||||
DEPENDENCY_PROPERTY(hstring, CurrentValue);
|
||||
DEPENDENCY_PROPERTY(bool, HasSettingValue);
|
||||
DEPENDENCY_PROPERTY(IInspectable, SettingOverrideSource);
|
||||
TYPED_EVENT(ClearSettingValue, Editor::SettingContainer, Windows::Foundation::IInspectable);
|
||||
|
|
|
@ -13,6 +13,9 @@ namespace Microsoft.Terminal.Settings.Editor
|
|||
String HelpText;
|
||||
static Windows.UI.Xaml.DependencyProperty HelpTextProperty { get; };
|
||||
|
||||
String CurrentValue;
|
||||
static Windows.UI.Xaml.DependencyProperty CurrentValueProperty { get; };
|
||||
|
||||
Boolean HasSettingValue;
|
||||
static Windows.UI.Xaml.DependencyProperty HasSettingValueProperty { get; };
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Microsoft.Terminal.Settings.Editor"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
|
@ -124,423 +125,6 @@
|
|||
<Setter Property="Foreground" Value="{ThemeResource SubgroupHeaderBrush}" />
|
||||
<Setter Property="TextWrapping" Value="WrapWholeWords" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="HeaderToggleButtonStyle"
|
||||
TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="{ThemeResource SystemControlTransparentBrush}" />
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="MinHeight" Value="64" />
|
||||
<Setter Property="Margin" Value="0,4,0,0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid x:Name="RootGrid"
|
||||
Background="{ThemeResource ExpanderHeaderBackground}"
|
||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||
BorderBrush="{ThemeResource ExpanderHeaderBorderBrush}"
|
||||
BorderThickness="{ThemeResource ExpanderHeaderBorderThickness}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle x:Name="HoverPanel"
|
||||
Grid.ColumnSpan="2"
|
||||
Fill="Transparent"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
StrokeThickness="{TemplateBinding BorderThickness}" />
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Grid.Column="0"
|
||||
Width="100000000"
|
||||
Margin="12,0,0,0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
RenderTransformOrigin="0.5,0.5" />
|
||||
<Slider x:Name="ArrowRotation"
|
||||
Maximum="180"
|
||||
Minimum="0"
|
||||
Visibility="Collapsed"
|
||||
Value="180" />
|
||||
<FontIcon x:Name="Arrow"
|
||||
Grid.Column="1"
|
||||
Margin="12"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
Glyph=""
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<FontIcon.RenderTransform>
|
||||
<RotateTransform />
|
||||
</FontIcon.RenderTransform>
|
||||
</FontIcon>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<Storyboard>
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="0.0"
|
||||
Duration="0:0:0" />
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{TemplateBinding BorderBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundListLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderBorderBrushExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="0.0"
|
||||
Duration="0:0:0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundListMediumBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderBorderBrushExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="0.0"
|
||||
Duration="0:0:0" />
|
||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="0.0"
|
||||
Duration="0:0:0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlTransparentBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{TemplateBinding BorderBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="{Binding ElementName=ArrowRotation, Path=Value}"
|
||||
Duration="0:0:0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightListAccentMediumBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderBorderBrushExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderTextColorExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderTextColorExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="{Binding ElementName=ArrowRotation, Path=Value}"
|
||||
Duration="0:0:0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightListAccentHighBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Stroke">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderBorderBrushExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderTextColorExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource ExpanderTextColorExpandedPointerOver}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="{Binding ElementName=ArrowRotation, Path=Value}"
|
||||
Duration="0:0:0" />
|
||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimation BeginTime="0:0:0"
|
||||
Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
To="{Binding ElementName=ArrowRotation, Path=Value}"
|
||||
Duration="0:0:0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Indeterminate">
|
||||
<Storyboard>
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="IndeterminatePointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="IndeterminatePressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="IndeterminateDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HoverPanel"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0"
|
||||
Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="ExpandDirectionStates">
|
||||
<VisualState x:Name="RightDirection" />
|
||||
<VisualState x:Name="DownDirection" />
|
||||
<VisualState x:Name="LeftDirection">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ArrowRotation.Value" Value="-90" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="UpDirection">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ArrowRotation.Value" Value="-90" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="local:SettingContainer"
|
||||
x:Key="AlternativeSettingContainerStyle">
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="local:SettingContainer">
|
||||
<Border>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- Expander header -->
|
||||
<ToggleButton x:Name="ExpanderButton"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="1"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Style="{StaticResource HeaderToggleButtonStyle}">
|
||||
<ToggleButton.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{TemplateBinding Header}" />
|
||||
<TextBlock FontSize="12"
|
||||
FontWeight="Normal"
|
||||
Style="{ThemeResource SecondaryTextBlockStyle}"
|
||||
Text="{TemplateBinding HelpText}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ToggleButton.Content>
|
||||
</ToggleButton>
|
||||
|
||||
<!-- Expander content -->
|
||||
<Border x:Name="MainContentContainer"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
Height="Auto"
|
||||
Margin="0,0,0,2"
|
||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||
BorderThickness="{ThemeResource ExpanderHeaderBorderThickness}"
|
||||
BorderBrush="{ThemeResource ExpanderHeaderBorderBrush}"
|
||||
Visibility="Collapsed"
|
||||
Background="{ThemeResource CardStrokeColorDefaultBrush}">
|
||||
<ContentPresenter HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Margin="16,4,16,8"
|
||||
Content="{TemplateBinding Content}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- Visual states -->
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ViewStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition GeneratedDuration="0:0:0" />
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Collapsed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainContentContainer"
|
||||
Storyboard.TargetProperty="(UIElement.Visibility)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0"
|
||||
Value="Collapsed" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Expanded">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainContentContainer"
|
||||
Storyboard.TargetProperty="(UIElement.Visibility)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0"
|
||||
Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="local:SettingContainer">
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
|
@ -576,4 +160,42 @@
|
|||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="local:SettingContainer"
|
||||
x:Key="ExpanderSettingContainerStyle">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="local:SettingContainer">
|
||||
<muxc:Expander Margin="0,4,8,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch">
|
||||
<muxc:Expander.Header>
|
||||
<Grid MinHeight="64">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Text="{TemplateBinding Header}"
|
||||
Style="{StaticResource SettingsPageItemHeaderStyle}" />
|
||||
<TextBlock Text="{TemplateBinding HelpText}"
|
||||
Style="{StaticResource SettingsPageItemDescriptionStyle}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,0,-16,0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SettingsPageItemDescriptionStyle}"
|
||||
Text="{TemplateBinding CurrentValue}"/>
|
||||
</Grid>
|
||||
</muxc:Expander.Header>
|
||||
<muxc:Expander.Content>
|
||||
<ContentPresenter Content="{TemplateBinding Content}"/>
|
||||
</muxc:Expander.Content>
|
||||
</muxc:Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
Loading…
Reference in a new issue