|
616 | 616 | </Grid> |
617 | 617 | </ControlTemplate> |
618 | 618 |
|
619 | | - <!-- TODO: Pull into separate file? --> |
620 | | - <Style BasedOn="{StaticResource ColorPickerSliderStyle}" |
621 | | - TargetType="controls:ColorPickerSlider" /> |
622 | | - |
623 | | - <Style x:Key="ColorPickerSliderStyle" |
624 | | - TargetType="controls:ColorPickerSlider"> |
625 | | - <Setter Property="VerticalAlignment" Value="Center" /> |
626 | | - <Setter Property="IsThumbToolTipEnabled" Value="False" /> |
627 | | - <Setter Property="Template"> |
628 | | - <Setter.Value> |
629 | | - <!-- Based on WinUI version 2.4.2 --> |
630 | | - <ControlTemplate TargetType="controls:ColorPickerSlider"> |
631 | | - <Grid Margin="{TemplateBinding Padding}"> |
632 | | - <Grid.Resources> |
633 | | - <Style x:Key="SliderThumbStyle" |
634 | | - TargetType="Thumb"> |
635 | | - <Setter Property="BorderThickness" Value="3" /> |
636 | | - <Setter Property="Background" Value="Transparent" /> |
637 | | - <Setter Property="Template"> |
638 | | - <Setter.Value> |
639 | | - <ControlTemplate TargetType="Thumb"> |
640 | | - <Border Background="{TemplateBinding Background}" |
641 | | - BorderBrush="{TemplateBinding BorderBrush}" |
642 | | - BorderThickness="{TemplateBinding BorderThickness}" |
643 | | - CornerRadius="{ThemeResource SliderThumbCornerRadius}" /> |
644 | | - </ControlTemplate> |
645 | | - </Setter.Value> |
646 | | - </Setter> |
647 | | - </Style> |
648 | | - </Grid.Resources> |
649 | | - |
650 | | - <Grid x:Name="SliderContainer" |
651 | | - Background="{ThemeResource SliderContainerBackground}" |
652 | | - Control.IsTemplateFocusTarget="True"> |
653 | | - <Grid x:Name="HorizontalTemplate" |
654 | | - MinHeight="20"> |
655 | | - |
656 | | - <Grid.ColumnDefinitions> |
657 | | - <ColumnDefinition Width="Auto" /> |
658 | | - <ColumnDefinition Width="Auto" /> |
659 | | - <ColumnDefinition Width="*" /> |
660 | | - </Grid.ColumnDefinitions> |
661 | | - |
662 | | - <Grid.RowDefinitions> |
663 | | - <RowDefinition Height="0" /> |
664 | | - <RowDefinition Height="*" /> |
665 | | - <RowDefinition Height="0" /> |
666 | | - </Grid.RowDefinitions> |
667 | | - |
668 | | - <Rectangle x:Name="HorizontalTrackRect" |
669 | | - Grid.Row="1" |
670 | | - Grid.ColumnSpan="3" |
671 | | - Height="20" |
672 | | - Fill="{TemplateBinding Background}" |
673 | | - RadiusX="10" |
674 | | - RadiusY="10" /> |
675 | | - <Rectangle x:Name="HorizontalDecreaseRect" |
676 | | - Grid.Row="1" |
677 | | - Fill="Transparent" |
678 | | - RadiusX="8" |
679 | | - RadiusY="8" /> |
680 | | - <Thumb x:Name="HorizontalThumb" |
681 | | - Grid.Row="0" |
682 | | - Grid.RowSpan="3" |
683 | | - Grid.Column="1" |
684 | | - Width="20" |
685 | | - Height="20" |
686 | | - AutomationProperties.AccessibilityView="Raw" |
687 | | - BorderBrush="{TemplateBinding BorderBrush}" |
688 | | - CornerRadius="10" |
689 | | - DataContext="{TemplateBinding Value}" |
690 | | - FocusVisualMargin="-14,-6,-14,-6" |
691 | | - Style="{StaticResource SliderThumbStyle}" /> |
692 | | - </Grid> |
693 | | - <Grid x:Name="VerticalTemplate" |
694 | | - MinWidth="20" |
695 | | - Visibility="Collapsed"> |
696 | | - |
697 | | - <Grid.RowDefinitions> |
698 | | - <RowDefinition Height="*" /> |
699 | | - <RowDefinition Height="Auto" /> |
700 | | - <RowDefinition Height="Auto" /> |
701 | | - </Grid.RowDefinitions> |
702 | | - |
703 | | - <Grid.ColumnDefinitions> |
704 | | - <ColumnDefinition Width="0" /> |
705 | | - <ColumnDefinition Width="*" /> |
706 | | - <ColumnDefinition Width="0" /> |
707 | | - </Grid.ColumnDefinitions> |
708 | | - |
709 | | - <Rectangle x:Name="VerticalTrackRect" |
710 | | - Grid.RowSpan="3" |
711 | | - Grid.Column="1" |
712 | | - Width="20" |
713 | | - Fill="{TemplateBinding Background}" |
714 | | - RadiusX="10" |
715 | | - RadiusY="10" /> |
716 | | - <Rectangle x:Name="VerticalDecreaseRect" |
717 | | - Grid.Row="2" |
718 | | - Grid.Column="1" |
719 | | - Fill="Transparent" |
720 | | - RadiusX="8" |
721 | | - RadiusY="8" /> |
722 | | - <Thumb x:Name="VerticalThumb" |
723 | | - Grid.Row="1" |
724 | | - Grid.Column="0" |
725 | | - Grid.ColumnSpan="3" |
726 | | - Width="20" |
727 | | - Height="20" |
728 | | - AutomationProperties.AccessibilityView="Raw" |
729 | | - BorderBrush="{TemplateBinding BorderBrush}" |
730 | | - CornerRadius="10" |
731 | | - DataContext="{TemplateBinding Value}" |
732 | | - FocusVisualMargin="-6,-14,-6,-14" |
733 | | - Style="{StaticResource SliderThumbStyle}" /> |
734 | | - </Grid> |
735 | | - </Grid> |
736 | | - |
737 | | - <VisualStateManager.VisualStateGroups> |
738 | | - <VisualStateGroup x:Name="CommonStates"> |
739 | | - <VisualState x:Name="Normal" /> |
740 | | - |
741 | | - <!-- |
742 | | - The Pressed state is purposely the same as normal. |
743 | | - This ensures that the thumb always has the correct contrast with |
744 | | - the selected color underneath it when dragging or moving. |
745 | | - --> |
746 | | - <VisualState x:Name="Pressed" /> |
747 | | - |
748 | | - <VisualState x:Name="Disabled"> |
749 | | - <VisualState.Setters> |
750 | | - <Setter Target="HorizontalThumb.BorderBrush" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> |
751 | | - <Setter Target="VerticalThumb.BorderBrush" Value="{ThemeResource SliderThumbBackgroundDisabled}" /> |
752 | | - <Setter Target="SliderContainer.Background" Value="{ThemeResource SliderContainerBackgroundDisabled}" /> |
753 | | - </VisualState.Setters> |
754 | | - </VisualState> |
755 | | - |
756 | | - <VisualState x:Name="PointerOver"> |
757 | | - <VisualState.Setters> |
758 | | - <Setter Target="HorizontalThumb.BorderBrush" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> |
759 | | - <Setter Target="VerticalThumb.BorderBrush" Value="{ThemeResource SliderThumbBackgroundPointerOver}" /> |
760 | | - <Setter Target="SliderContainer.Background" Value="{ThemeResource SliderContainerBackgroundPointerOver}" /> |
761 | | - </VisualState.Setters> |
762 | | - </VisualState> |
763 | | - |
764 | | - </VisualStateGroup> |
765 | | - <VisualStateGroup x:Name="FocusEngagementStates"> |
766 | | - <VisualState x:Name="FocusDisengaged" /> |
767 | | - <VisualState x:Name="FocusEngagedHorizontal"> |
768 | | - <VisualState.Setters> |
769 | | - <Setter Target="SliderContainer.(Control.IsTemplateFocusTarget)" Value="False" /> |
770 | | - <Setter Target="HorizontalThumb.(Control.IsTemplateFocusTarget)" Value="True" /> |
771 | | - </VisualState.Setters> |
772 | | - </VisualState> |
773 | | - <VisualState x:Name="FocusEngagedVertical"> |
774 | | - <VisualState.Setters> |
775 | | - <Setter Target="SliderContainer.(Control.IsTemplateFocusTarget)" Value="False" /> |
776 | | - <Setter Target="VerticalThumb.(Control.IsTemplateFocusTarget)" Value="True" /> |
777 | | - </VisualState.Setters> |
778 | | - </VisualState> |
779 | | - |
780 | | - </VisualStateGroup> |
781 | | - |
782 | | - </VisualStateManager.VisualStateGroups> |
783 | | - </Grid> |
784 | | - </ControlTemplate> |
785 | | - </Setter.Value> |
786 | | - </Setter> |
787 | | - </Style> |
788 | | - |
789 | 619 | <Style x:Key="PaletteGridViewItemStyle" |
790 | 620 | TargetType="GridViewItem"> |
791 | 621 | <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> |
|
0 commit comments