New expander control.
This commit is contained in:
86
Wino.Mail/Styles/WinoExpanderStyle.xaml
Normal file
86
Wino.Mail/Styles/WinoExpanderStyle.xaml
Normal file
@@ -0,0 +1,86 @@
|
||||
<ResourceDictionary
|
||||
x:Class="Wino.Styles.WinoExpanderStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
||||
xmlns:controls="using:Wino.Controls"
|
||||
xmlns:local="using:Wino.Styles"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
|
||||
|
||||
<ControlTemplate x:Key="DefaultWinoThreadControlTemplate" TargetType="controls:WinoExpander">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- Header -->
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<muxc:AnimatedIcon
|
||||
xmlns:local="using:Microsoft.UI.Xaml.Controls"
|
||||
x:Name="ExpandCollapseChevron"
|
||||
Width="{StaticResource ExpanderChevronGlyphSize}"
|
||||
Height="{StaticResource ExpanderChevronGlyphSize}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
local:AnimatedIcon.State="NormalOff"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Foreground="{ThemeResource ExpanderChevronForeground}"
|
||||
RenderTransformOrigin="0.5, 0.5"
|
||||
Visibility="Collapsed">
|
||||
<animatedvisuals:AnimatedChevronRightDownSmallVisualSource />
|
||||
<muxc:AnimatedIcon.FallbackIconSource>
|
||||
<muxc:FontIconSource
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph="{StaticResource ExpanderChevronDownGlyph}"
|
||||
IsTextScaleFactorEnabled="False" />
|
||||
</muxc:AnimatedIcon.FallbackIconSource>
|
||||
<muxc:AnimatedIcon.RenderTransform />
|
||||
</muxc:AnimatedIcon>
|
||||
|
||||
|
||||
<ContentControl
|
||||
x:Name="HeaderGrid"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding Header}" />
|
||||
</Grid>
|
||||
|
||||
<ContentControl
|
||||
x:Name="ContentArea"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding Content}"
|
||||
Visibility="Collapsed" />
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="OpenCloseStates">
|
||||
<VisualState x:Name="Collapsed" />
|
||||
<VisualState x:Name="Expanded">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ExpandCollapseChevron.(controls:AnimatedIcon.State)" Value="NormalOn" />
|
||||
<Setter Target="ContentArea.Visibility" Value="Visible" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style TargetType="controls:WinoExpander">
|
||||
<Setter Property="Background" Value="{ThemeResource AppBarItemBackgroundThemeBrush}" />
|
||||
<Setter Property="Template" Value="{StaticResource DefaultWinoThreadControlTemplate}" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
12
Wino.Mail/Styles/WinoExpanderStyle.xaml.cs
Normal file
12
Wino.Mail/Styles/WinoExpanderStyle.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace Wino.Styles
|
||||
{
|
||||
partial class WinoExpanderStyle : ResourceDictionary
|
||||
{
|
||||
public WinoExpanderStyle()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user