124 lines
6.8 KiB
XML
124 lines
6.8 KiB
XML
<UserControl
|
|
x:Class="Wino.Controls.WinoPivotControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
d:DesignHeight="300"
|
|
d:DesignWidth="400"
|
|
Loaded="ControlLoaded"
|
|
Unloaded="ControlUnloaded"
|
|
mc:Ignorable="d">
|
|
|
|
<UserControl.Resources>
|
|
<Style x:Key="WinoPivotControlListViewItemStyle" TargetType="ListViewItem">
|
|
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
|
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
|
<Setter Property="Background" Value="{ThemeResource ListViewItemBackground}" />
|
|
<Setter Property="Foreground" Value="{ThemeResource ListViewItemForeground}" />
|
|
<Setter Property="TabNavigation" Value="Local" />
|
|
<Setter Property="IsHoldingEnabled" Value="True" />
|
|
<Setter Property="Padding" Value="12,4" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}" />
|
|
<Setter Property="MinHeight" Value="{ThemeResource ListViewItemMinHeight}" />
|
|
<Setter Property="AllowDrop" Value="False" />
|
|
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
|
|
<Setter Property="FocusVisualMargin" Value="0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ListViewItem">
|
|
<ListViewItemPresenter
|
|
x:Name="Root"
|
|
Margin="0,0,6,0"
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
CheckBoxBrush="{ThemeResource ListViewItemCheckBoxBrush}"
|
|
CheckBrush="{ThemeResource ListViewItemCheckBrush}"
|
|
CheckMode="{ThemeResource ListViewItemCheckMode}"
|
|
ContentMargin="{TemplateBinding Padding}"
|
|
ContentTransitions="{TemplateBinding ContentTransitions}"
|
|
Control.IsTemplateFocusTarget="True"
|
|
CornerRadius="6"
|
|
DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
|
|
DragBackground="{ThemeResource ListViewItemDragBackground}"
|
|
DragForeground="{ThemeResource ListViewItemDragForeground}"
|
|
DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
|
|
FocusBorderBrush="{ThemeResource ListViewItemFocusBorderBrush}"
|
|
FocusSecondaryBorderBrush="{ThemeResource ListViewItemFocusSecondaryBorderBrush}"
|
|
FocusVisualMargin="{TemplateBinding FocusVisualMargin}"
|
|
PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackground}"
|
|
PointerOverBackground="{ThemeResource ListViewItemBackgroundPointerOver}"
|
|
PointerOverForeground="{ThemeResource ListViewItemForegroundPointerOver}"
|
|
PressedBackground="Transparent"
|
|
ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
|
|
RevealBackground="Transparent"
|
|
RevealBorderBrush="Transparent"
|
|
RevealBorderThickness="{ThemeResource ListViewItemRevealBorderThemeThickness}"
|
|
SelectedBackground="Transparent"
|
|
SelectedForeground="{ThemeResource ApplicationForegroundThemeBrush}"
|
|
SelectedPointerOverBackground="{ThemeResource ListViewItemBackgroundPointerOver}"
|
|
SelectedPressedBackground="{ThemeResource ListViewItemBackgroundPointerOver}"
|
|
SelectionCheckMarkVisualEnabled="{ThemeResource ListViewItemSelectionCheckMarkVisualEnabled}">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="Selected" />
|
|
<VisualState x:Name="PointerOver" />
|
|
<VisualState x:Name="PointerOverSelected" />
|
|
<VisualState x:Name="PointerOverPressed" />
|
|
<VisualState x:Name="Pressed" />
|
|
<VisualState x:Name="PressedSelected" />
|
|
</VisualStateGroup>
|
|
|
|
<VisualStateGroup x:Name="DisabledStates">
|
|
<VisualState x:Name="Enabled" />
|
|
<VisualState x:Name="Disabled" />
|
|
</VisualStateGroup>
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
</ListViewItemPresenter>
|
|
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<ListView
|
|
x:Name="PivotHeaders"
|
|
ItemContainerStyle="{StaticResource WinoPivotControlListViewItemStyle}"
|
|
ItemTemplate="{x:Bind DataTemplate, Mode=OneWay}"
|
|
ItemsSource="{x:Bind ItemsSource, Mode=OneWay}"
|
|
Transitions="{x:Null}"
|
|
ItemContainerTransitions="{x:Null}"
|
|
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
|
|
SelectionChanged="PivotHeaders_SelectionChanged">
|
|
<ListView.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<ItemsStackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListView.ItemsPanel>
|
|
</ListView>
|
|
|
|
<Grid
|
|
x:Name="SelectorPipe"
|
|
Grid.Row="1"
|
|
Width="1"
|
|
Height="3"
|
|
Margin="0,6,0,0"
|
|
HorizontalAlignment="Left"
|
|
SizeChanged="SelectorPipeSizeChanged">
|
|
<Grid.TranslationTransition>
|
|
<Vector3Transition Duration="0:0:0.5" />
|
|
</Grid.TranslationTransition>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|