|
@@ -581,7 +581,236 @@ |
581 |
581 |
|
</Setter.Value> |
582 |
582 |
|
</Setter> |
583 |
583 |
|
</Style> |
|
584 |
+ |
|
|
585 |
+ |
|
|
586 |
+ |
<FontFamily x:Key="ContentControlThemeFontFamily">Segoe WP</FontFamily> |
|
587 |
+ |
<x:Double x:Key="ControlContentThemeFontSize">12</x:Double> |
|
588 |
+ |
<x:Double x:Key="TextStyleExtraLargeFontSize">25.5</x:Double> |
|
589 |
+ |
<SolidColorBrush x:Key="ToggleSwitchTrackBorderThemeBrush" Color="Transparent"/> |
|
590 |
+ |
<Style x:Key="ToggleSwitchStyleDefault" TargetType="ToggleSwitch"> |
|
591 |
+ |
<Setter Property="Foreground" Value="{ThemeResource ToggleSwitchForegroundThemeBrush}"/> |
|
592 |
+ |
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|
593 |
+ |
<Setter Property="VerticalAlignment" Value="Center"/> |
|
594 |
+ |
<Setter Property="HorizontalContentAlignment" Value="Left"/> |
|
595 |
+ |
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> |
|
596 |
+ |
<Setter Property="FontWeight" Value="SemiBold"/> |
|
597 |
+ |
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> |
|
598 |
+ |
<Setter Property="Margin" Value="0"/> |
|
599 |
+ |
<Setter Property="Padding" Value="0,0,25.5,0"/> |
|
600 |
+ |
<Setter Property="Template"> |
|
601 |
+ |
<Setter.Value> |
|
602 |
+ |
<ControlTemplate TargetType="ToggleSwitch"> |
|
603 |
+ |
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> |
|
604 |
+ |
<VisualStateManager.VisualStateGroups> |
|
605 |
+ |
<VisualStateGroup x:Name="CommonStates"> |
|
606 |
+ |
<VisualState x:Name="Normal"/> |
|
607 |
+ |
<VisualState x:Name="PointerOver"/> |
|
608 |
+ |
<VisualState x:Name="Pressed"/> |
|
609 |
+ |
<VisualState x:Name="Disabled"> |
|
610 |
+ |
<Storyboard> |
|
611 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="HeaderContentPresenter"> |
|
612 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchDisabledForegroundThemeBrush}"/> |
|
613 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
614 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="OffContentPresenter"> |
|
615 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchDisabledForegroundThemeBrush}"/> |
|
616 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
617 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="OnContentPresenter"> |
|
618 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchDisabledForegroundThemeBrush}"/> |
|
619 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
620 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="SwitchKnob"> |
|
621 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbDisabledBackgroundThemeBrush}"/> |
|
622 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
623 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="SwitchKnob"> |
|
624 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchThumbDisabledBorderThemeBrush}"/> |
|
625 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
626 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="OuterBorder"> |
|
627 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchOuterBorderDisabledBorderThemeBrush}"/> |
|
628 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
629 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="SwitchCurtain"> |
|
630 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchCurtainDisabledBackgroundThemeBrush}"/> |
|
631 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
632 |
+ |
</Storyboard> |
|
633 |
+ |
</VisualState> |
|
634 |
+ |
</VisualStateGroup> |
|
635 |
+ |
<VisualStateGroup x:Name="ToggleStates"> |
|
636 |
+ |
<VisualStateGroup.Transitions> |
|
637 |
+ |
<VisualTransition x:Name="DraggingToOnTransition" From="Dragging" GeneratedDuration="0" To="On"> |
|
638 |
+ |
<Storyboard> |
|
639 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.KnobCurrentToOnOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchKnob"/> |
|
640 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.CurtainCurrentToOnOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchCurtain"/> |
|
641 |
+ |
</Storyboard> |
|
642 |
+ |
</VisualTransition> |
|
643 |
+ |
<VisualTransition x:Name="DraggingToOffTransition" From="Dragging" GeneratedDuration="0" To="Off"> |
|
644 |
+ |
<Storyboard> |
|
645 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.KnobCurrentToOffOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchKnob"/> |
|
646 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.CurtainCurrentToOffOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchCurtain"/> |
|
647 |
+ |
</Storyboard> |
|
648 |
+ |
</VisualTransition> |
|
649 |
+ |
<VisualTransition x:Name="OnToOffTransition" From="On" GeneratedDuration="0" To="Off"> |
|
650 |
+ |
<Storyboard> |
|
651 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.KnobOnToOffOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchKnob"/> |
|
652 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.CurtainOnToOffOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchCurtain"/> |
|
653 |
+ |
</Storyboard> |
|
654 |
+ |
</VisualTransition> |
|
655 |
+ |
<VisualTransition x:Name="OffToOnTransition" From="Off" GeneratedDuration="0" To="On"> |
|
656 |
+ |
<Storyboard> |
|
657 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.KnobOffToOnOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchKnob"/> |
|
658 |
+ |
<RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.CurtainOffToOnOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}" Storyboard.TargetName="SwitchCurtain"/> |
|
659 |
+ |
</Storyboard> |
|
660 |
+ |
</VisualTransition> |
|
661 |
+ |
</VisualStateGroup.Transitions> |
|
662 |
+ |
<VisualState x:Name="Dragging"/> |
|
663 |
+ |
<VisualState x:Name="Off"> |
|
664 |
+ |
<Storyboard> |
|
665 |
+ |
<DoubleAnimation Duration="0" To="-64" Storyboard.TargetProperty="X" Storyboard.TargetName="CurtainTranslateTransform"/> |
|
666 |
+ |
</Storyboard> |
|
667 |
+ |
</VisualState> |
|
668 |
+ |
<VisualState x:Name="On"> |
|
669 |
+ |
<Storyboard> |
|
670 |
+ |
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="CurtainTranslateTransform"/> |
|
671 |
+ |
<DoubleAnimation Duration="0" To="56.5" Storyboard.TargetProperty="X" Storyboard.TargetName="KnobTranslateTransform"/> |
|
672 |
+ |
</Storyboard> |
|
673 |
+ |
</VisualState> |
|
674 |
+ |
</VisualStateGroup> |
|
675 |
+ |
<VisualStateGroup x:Name="ContentStates"> |
|
676 |
+ |
<VisualState x:Name="OffContent"> |
|
677 |
+ |
<Storyboard> |
|
678 |
+ |
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="OffContentPresenter"/> |
|
679 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OffContentPresenter"> |
|
680 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="True"/> |
|
681 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
682 |
+ |
</Storyboard> |
|
683 |
+ |
</VisualState> |
|
684 |
+ |
<VisualState x:Name="OnContent"> |
|
685 |
+ |
<Storyboard> |
|
686 |
+ |
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="OnContentPresenter"/> |
|
687 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="OnContentPresenter"> |
|
688 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="True"/> |
|
689 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
690 |
+ |
</Storyboard> |
|
691 |
+ |
</VisualState> |
|
692 |
+ |
</VisualStateGroup> |
|
693 |
+ |
</VisualStateManager.VisualStateGroups> |
|
694 |
+ |
<Grid Background="Transparent"> |
|
695 |
+ |
<Grid.ColumnDefinitions> |
|
696 |
+ |
<ColumnDefinition Width="*"/> |
|
697 |
+ |
<ColumnDefinition Width="13.5"/> |
|
698 |
+ |
<ColumnDefinition Width="77"/> |
|
699 |
+ |
</Grid.ColumnDefinitions> |
|
700 |
+ |
<Grid.RowDefinitions> |
|
701 |
+ |
<RowDefinition Height="Auto"/> |
|
702 |
+ |
<RowDefinition Height="Auto"/> |
|
703 |
+ |
<RowDefinition Height="9.5"/> |
|
704 |
+ |
</Grid.RowDefinitions> |
|
705 |
+ |
<ContentPresenter x:Name="HeaderContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{ThemeResource ToggleSwitchHeaderForegroundThemeBrush}" Margin="{TemplateBinding Padding}" Style="{StaticResource HeaderContentPresenterStyle}"/> |
|
706 |
+ |
<Grid Margin="{TemplateBinding Padding}" Grid.Row="1"> |
|
707 |
+ |
<ContentPresenter x:Name="OffContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding OffContentTemplate}" Content="{TemplateBinding OffContent}" FontWeight="Normal" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" FontFamily="{ThemeResource PhoneFontFamilyNormal}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Opacity="0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|
708 |
+ |
<ContentPresenter x:Name="OnContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding OnContentTemplate}" Content="{TemplateBinding OnContent}" FontWeight="Normal" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" FontFamily="{ThemeResource PhoneFontFamilyNormal}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" Opacity="0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|
709 |
+ |
</Grid> |
|
710 |
+ |
<Grid Grid.Column="2" ManipulationMode="None" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Bottom"> |
|
711 |
+ |
<Grid x:Name="SwitchKnobBounds" Height="36"> |
|
712 |
+ |
<Border x:Name="OuterBorder" BorderBrush="{ThemeResource ToggleSwitchOuterBorderBorderThemeBrush}" BorderThickness="2.5" Margin="3,4.5,3,4.5"> |
|
713 |
+ |
<Border x:Name="InnerBorder" BorderBrush="#FF564966" BorderThickness="2.5"> |
|
714 |
+ |
<ContentPresenter x:Name="SwitchCurtainBounds"> |
|
715 |
+ |
<ContentPresenter x:Name="SwitchCurtainClip"> |
|
716 |
+ |
<Rectangle x:Name="SwitchCurtain" Fill="#FF2CDAFF" Width="64"> |
|
717 |
+ |
<Rectangle.RenderTransform> |
|
718 |
+ |
<TranslateTransform x:Name="CurtainTranslateTransform" X="-64"/> |
|
719 |
+ |
</Rectangle.RenderTransform> |
|
720 |
+ |
</Rectangle> |
|
721 |
+ |
</ContentPresenter> |
|
722 |
+ |
</ContentPresenter> |
|
723 |
+ |
</Border> |
|
724 |
+ |
</Border> |
|
725 |
+ |
<Rectangle x:Name="SwitchKnob" Fill="{ThemeResource ToggleSwitchThumbBackgroundThemeBrush}" HorizontalAlignment="Left" Stroke="#FF564966" StrokeThickness="2.5" Width="20.5"> |
|
726 |
+ |
<Rectangle.RenderTransform> |
|
727 |
+ |
<TranslateTransform x:Name="KnobTranslateTransform"/> |
|
728 |
+ |
</Rectangle.RenderTransform> |
|
729 |
+ |
</Rectangle> |
|
730 |
+ |
</Grid> |
|
731 |
+ |
<Thumb x:Name="SwitchThumb" AutomationProperties.AccessibilityView="Raw" Margin="-13.5,-15.5,-13.5,-6.5"> |
|
732 |
+ |
<Thumb.Template> |
|
733 |
+ |
<ControlTemplate TargetType="Thumb"> |
|
734 |
+ |
<Rectangle Fill="Transparent"/> |
|
735 |
+ |
</ControlTemplate> |
|
736 |
+ |
</Thumb.Template> |
|
737 |
+ |
</Thumb> |
|
738 |
+ |
</Grid> |
|
739 |
+ |
</Grid> |
|
740 |
+ |
</Border> |
|
741 |
+ |
</ControlTemplate> |
|
742 |
+ |
</Setter.Value> |
|
743 |
+ |
</Setter> |
|
744 |
+ |
</Style> |
|
745 |
+ |
|
584 |
746 |
|
|
|
747 |
+ |
<SolidColorBrush x:Key="AppBarItemForegroundThemeBrush2" Color="#FF2CDAFF"/> |
|
748 |
+ |
<SolidColorBrush x:Key="AppBarItemBackgroundThemeBrush" Color="Transparent"/> |
|
749 |
+ |
<Style x:Key="AppBarButtonStyleStandard" TargetType="AppBarButton"> |
|
750 |
+ |
<Setter Property="VerticalAlignment" Value="Top"/> |
|
751 |
+ |
<Setter Property="HorizontalAlignment" Value="Left"/> |
|
752 |
+ |
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> |
|
753 |
+ |
<Setter Property="FontWeight" Value="Normal"/> |
|
754 |
+ |
<Setter Property="Template"> |
|
755 |
+ |
<Setter.Value> |
|
756 |
+ |
<ControlTemplate TargetType="AppBarButton"> |
|
757 |
+ |
<StackPanel x:Name="LayoutRoot" Background="Transparent" HorizontalAlignment="Stretch"> |
|
758 |
+ |
<VisualStateManager.VisualStateGroups> |
|
759 |
+ |
<VisualStateGroup x:Name="ApplicationViewStates"> |
|
760 |
+ |
<VisualState x:Name="FullSize"/> |
|
761 |
+ |
<VisualState x:Name="Compact"> |
|
762 |
+ |
<Storyboard> |
|
763 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="TextLabel"> |
|
764 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> |
|
765 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
766 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Storyboard.TargetName="LayoutRoot"> |
|
767 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="48"/> |
|
768 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
769 |
+ |
</Storyboard> |
|
770 |
+ |
</VisualState> |
|
771 |
+ |
</VisualStateGroup> |
|
772 |
+ |
<VisualStateGroup x:Name="CommonStates"> |
|
773 |
+ |
<VisualState x:Name="Normal"/> |
|
774 |
+ |
<VisualState x:Name="Pressed"> |
|
775 |
+ |
<Storyboard> |
|
776 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="Ellipse"> |
|
777 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemForegroundThemeBrush}"/> |
|
778 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
779 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="Ellipse"> |
|
780 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemForegroundThemeBrush}"/> |
|
781 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
782 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Content"> |
|
783 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemPressedForegroundThemeBrush}"/> |
|
784 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
785 |
+ |
</Storyboard> |
|
786 |
+ |
</VisualState> |
|
787 |
+ |
<VisualState x:Name="Disabled"> |
|
788 |
+ |
<Storyboard> |
|
789 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="Ellipse"> |
|
790 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}"/> |
|
791 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
792 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="Content"> |
|
793 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}"/> |
|
794 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
795 |
+ |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextLabel"> |
|
796 |
+ |
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource AppBarItemDisabledForegroundThemeBrush}"/> |
|
797 |
+ |
</ObjectAnimationUsingKeyFrames> |
|
798 |
+ |
</Storyboard> |
|
799 |
+ |
</VisualState> |
|
800 |
+ |
</VisualStateGroup> |
|
801 |
+ |
</VisualStateManager.VisualStateGroups> |
|
802 |
+ |
<Grid HorizontalAlignment="Center" Margin="0" Width="{TemplateBinding Width}" Height="{TemplateBinding Width}"> |
|
803 |
+ |
<Ellipse x:Name="Ellipse" Fill="{ThemeResource AppBarItemBackgroundThemeBrush}" Stroke="{TemplateBinding Foreground}" StrokeThickness="2.5" UseLayoutRounding="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> |
|
804 |
+ |
<Grid x:Name="ContentRoot" Background="Transparent"> |
|
805 |
+ |
<ContentPresenter x:Name="Content" AutomationProperties.AccessibilityView="Raw" Content="{TemplateBinding Icon}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontSize="{TemplateBinding FontSize}"/> |
|
806 |
+ |
</Grid> |
|
807 |
+ |
</Grid> |
|
808 |
+ |
<TextBlock x:Name="TextLabel" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Margin="0,0,0,10.5" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding Label}" HorizontalAlignment="Stretch"/> |
|
809 |
+ |
</StackPanel> |
|
810 |
+ |
</ControlTemplate> |
|
811 |
+ |
</Setter.Value> |
|
812 |
+ |
</Setter> |
|
813 |
+ |
</Style> |
585 |
814 |
|
|
586 |
815 |
|
|
587 |
816 |
|
</ResourceDictionary> |