|
1 | | -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 1 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | 3 | xmlns:local="using:CommunityToolkit.WinUI.Controls" |
4 | 4 | xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
|
665 | 665 | </Viewbox> |
666 | 666 |
|
667 | 667 | <ContentPresenter x:Name="PART_ContentPresenter" |
668 | | - Grid.Column="1" |
669 | 668 | Margin="0,5,0,6" |
670 | 669 | VerticalAlignment="Center" |
671 | 670 | win:HighContrastAdjustment="None" |
|
713 | 712 | Control.IsTemplateFocusTarget="True" |
714 | 713 | CornerRadius="{TemplateBinding CornerRadius}"> |
715 | 714 | <VisualStateManager.VisualStateGroups> |
| 715 | + <VisualStateGroup x:Name="SegmentedOrientationStates"> |
| 716 | + <VisualState x:Name="Horizontal" /> |
| 717 | + <VisualState x:Name="Vertical"> |
| 718 | + <VisualState.Setters> |
| 719 | + <Setter Target="PART_Pill.HorizontalAlignment" Value="Left" /> |
| 720 | + <Setter Target="PART_Pill.VerticalAlignment" Value="Center" /> |
| 721 | + <Setter Target="PART_Pill.(UIElement.RenderTransform).(CompositeTransform.Rotation)" Value="90" /> |
| 722 | + </VisualState.Setters> |
| 723 | + </VisualState> |
| 724 | + </VisualStateGroup> |
716 | 725 | <VisualStateGroup x:Name="SegmentedIconPositionStates"> |
717 | | - <VisualState x:Name="IconOnLeft" /> |
| 726 | + <VisualState x:Name="IconLeft" /> |
718 | 727 | <VisualState x:Name="IconOnly"> |
719 | 728 | <VisualState.Setters> |
720 | 729 | <Setter Target="PART_ContentPresenter.Visibility" Value="Collapsed" /> |
721 | | - <Setter Target="PART_Pill.(Grid.Column)" Value="0" /> |
722 | | - <Setter Target="ContentHolder.ColumnSpacing" Value="0" /> |
723 | 730 | </VisualState.Setters> |
724 | 731 | </VisualState> |
725 | 732 | <VisualState x:Name="ContentOnly"> |
726 | 733 | <VisualState.Setters> |
727 | 734 | <Setter Target="PART_IconBox.Visibility" Value="Collapsed" /> |
728 | | - <Setter Target="ContentHolder.ColumnSpacing" Value="0" /> |
729 | 735 | </VisualState.Setters> |
730 | 736 | </VisualState> |
731 | 737 | </VisualStateGroup> |
|
878 | 884 | </VisualStateManager.VisualStateGroups> |
879 | 885 |
|
880 | 886 | <!-- Content --> |
881 | | - <Grid x:Name="ContentHolder" |
882 | | - Margin="12,0,12,0" |
883 | | - HorizontalAlignment="Center" |
884 | | - VerticalAlignment="Stretch" |
885 | | - ColumnSpacing="8"> |
886 | | - <Grid.ColumnDefinitions> |
887 | | - <ColumnDefinition Width="Auto" /> |
888 | | - <ColumnDefinition Width="Auto" /> |
889 | | - </Grid.ColumnDefinitions> |
| 887 | + <StackPanel x:Name="ContentHolder" |
| 888 | + Margin="12,0,12,0" |
| 889 | + HorizontalAlignment="Center" |
| 890 | + VerticalAlignment="Stretch" |
| 891 | + Spacing="8"> |
890 | 892 | <Viewbox x:Name="PART_IconBox" |
891 | 893 | Width="16" |
892 | 894 | Margin="0,11,0,11" |
|
898 | 900 | </Viewbox> |
899 | 901 |
|
900 | 902 | <ContentPresenter x:Name="PART_ContentPresenter" |
901 | | - Grid.Column="1" |
902 | 903 | Margin="0,9,0,10" |
903 | 904 | VerticalAlignment="Center" |
904 | 905 | win:HighContrastAdjustment="None" |
|
908 | 909 | ContentTransitions="{TemplateBinding ContentTransitions}" |
909 | 910 | FontWeight="{TemplateBinding FontWeight}" |
910 | 911 | Foreground="{TemplateBinding Foreground}" /> |
911 | | - <Rectangle x:Name="PART_Pill" |
912 | | - Grid.Column="1" |
913 | | - Width="4" |
914 | | - Height="3" |
915 | | - HorizontalAlignment="Center" |
916 | | - VerticalAlignment="Bottom" |
917 | | - Fill="{ThemeResource PivotItemPillBackground}" |
918 | | - Opacity="0" |
919 | | - RadiusX="0.5" |
920 | | - RadiusY="1" |
921 | | - RenderTransformOrigin="0.5, 0.5"> |
922 | | - <Rectangle.RenderTransform> |
923 | | - <CompositeTransform x:Name="PillTransform" |
924 | | - ScaleX="1" /> |
925 | | - </Rectangle.RenderTransform> |
926 | | - </Rectangle> |
927 | | - </Grid> |
| 912 | + |
| 913 | + </StackPanel> |
| 914 | + <Rectangle x:Name="PART_Pill" |
| 915 | + Width="4" |
| 916 | + Height="3" |
| 917 | + HorizontalAlignment="Center" |
| 918 | + VerticalAlignment="Bottom" |
| 919 | + Fill="{ThemeResource PivotItemPillBackground}" |
| 920 | + Opacity="0" |
| 921 | + RadiusX="0.5" |
| 922 | + RadiusY="1" |
| 923 | + RenderTransformOrigin="0.5, 1"> |
| 924 | + <Rectangle.RenderTransform> |
| 925 | + <CompositeTransform x:Name="PillTransform" |
| 926 | + ScaleX="1" /> |
| 927 | + </Rectangle.RenderTransform> |
| 928 | + </Rectangle> |
928 | 929 | </Grid> |
929 | 930 | </ControlTemplate> |
930 | 931 | </Setter.Value> |
|
0 commit comments