|
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"> |
|
405 | 405 | <win:BrushTransition Duration="0:0:0.083" /> |
406 | 406 | </win:Grid.BackgroundTransition> |
407 | 407 | <VisualStateManager.VisualStateGroups> |
| 408 | + <VisualStateGroup x:Name="SegmentedOrientationStates"> |
| 409 | + <VisualState x:Name="Horizontal" /> |
| 410 | + <VisualState x:Name="Vertical"> |
| 411 | + <VisualState.Setters> |
| 412 | + <Setter Target="PART_Pill.HorizontalAlignment" Value="Left" /> |
| 413 | + <Setter Target="PART_Pill.VerticalAlignment" Value="Center" /> |
| 414 | + <Setter Target="PART_Pill.(UIElement.RenderTransform).(CompositeTransform.Rotation)" Value="90" /> |
| 415 | + </VisualState.Setters> |
| 416 | + </VisualState> |
| 417 | + </VisualStateGroup> |
408 | 418 | <VisualStateGroup x:Name="SegmentedIconPositionStates"> |
409 | | - <VisualState x:Name="IconOnLeft" /> |
| 419 | + <VisualState x:Name="IconLeft" /> |
| 420 | + <VisualState x:Name="IconTop"> |
| 421 | + <VisualState.Setters> |
| 422 | + <Setter Target="ContentHolder.ColumnSpacing" Value="0" /> |
| 423 | + <Setter Target="ContentHolder.MaxWidth" Value="64" /> |
| 424 | + <Setter Target="PART_IconBox.Width" Value="20" /> |
| 425 | + <Setter Target="PART_IconBox.HorizontalAlignment" Value="Center" /> |
| 426 | + <Setter Target="PART_ContentPresenter.(Grid.Column)" Value="0" /> |
| 427 | + <Setter Target="PART_ContentPresenter.(Grid.Row)" Value="1" /> |
| 428 | + <Setter Target="PART_ContentPresenter.MaxWidth" Value="48" /> |
| 429 | + <Setter Target="PART_ContentPresenter.HorizontalAlignment" Value="Center" /> |
| 430 | + </VisualState.Setters> |
| 431 | + </VisualState> |
410 | 432 | <VisualState x:Name="IconOnly"> |
411 | 433 | <VisualState.Setters> |
412 | 434 | <Setter Target="PART_ContentPresenter.Visibility" Value="Collapsed" /> |
413 | | - <Setter Target="PART_Pill.(Grid.Column)" Value="0" /> |
414 | 435 | <Setter Target="ContentHolder.ColumnSpacing" Value="0" /> |
415 | 436 | </VisualState.Setters> |
416 | 437 | </VisualState> |
|
634 | 655 | <ColumnDefinition Width="Auto" /> |
635 | 656 | <ColumnDefinition Width="Auto" /> |
636 | 657 | </Grid.ColumnDefinitions> |
| 658 | + <Grid.RowDefinitions> |
| 659 | + <RowDefinition Height="Auto" /> |
| 660 | + <RowDefinition Height="Auto" /> |
| 661 | + </Grid.RowDefinitions> |
637 | 662 | <Viewbox x:Name="PART_IconBox" |
638 | 663 | Width="16" |
639 | 664 | Margin="0,7,0,7" |
|
655 | 680 | ContentTransitions="{TemplateBinding ContentTransitions}" |
656 | 681 | FontWeight="{TemplateBinding FontWeight}" |
657 | 682 | Foreground="{TemplateBinding Foreground}" /> |
658 | | - <Rectangle x:Name="PART_Pill" |
659 | | - Grid.Column="1" |
660 | | - Width="4" |
661 | | - Height="3" |
662 | | - HorizontalAlignment="Center" |
663 | | - VerticalAlignment="Bottom" |
664 | | - Fill="{ThemeResource SegmentedPillBackground}" |
665 | | - Opacity="0" |
666 | | - RadiusX="0.5" |
667 | | - RadiusY="1" |
668 | | - RenderTransformOrigin="0.5, 0.5"> |
669 | | - <Rectangle.RenderTransform> |
670 | | - <CompositeTransform x:Name="PillTransform" |
671 | | - ScaleX="1" /> |
672 | | - </Rectangle.RenderTransform> |
673 | | - </Rectangle> |
674 | 683 | </Grid> |
| 684 | + |
| 685 | + <Rectangle x:Name="PART_Pill" |
| 686 | + Width="4" |
| 687 | + Height="3" |
| 688 | + HorizontalAlignment="Center" |
| 689 | + VerticalAlignment="Bottom" |
| 690 | + Fill="{ThemeResource SegmentedPillBackground}" |
| 691 | + Opacity="0" |
| 692 | + RadiusX="0.5" |
| 693 | + RadiusY="1" |
| 694 | + RenderTransformOrigin="0.5, 0"> |
| 695 | + <Rectangle.RenderTransform> |
| 696 | + <CompositeTransform x:Name="PillTransform" |
| 697 | + ScaleX="1" /> |
| 698 | + </Rectangle.RenderTransform> |
| 699 | + </Rectangle> |
675 | 700 | </Grid> |
676 | 701 | </ControlTemplate> |
677 | 702 | </Setter.Value> |
|
0 commit comments