Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
379 lines (367 sloc) 27 KB
<ResourceDictionary 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"
xmlns:controls="using:Continuity.Controls"
mc:Ignorable="d">
<Style TargetType="controls:CircularToggleButton">
<Setter Property="Background"
Value="#FFF4F4F4" />
<Setter Property="Foreground"
Value="#FF182127" />
<Setter Property="CheckedBackground"
Value="#FF182127" />
<Setter Property="CheckedForeground"
Value="White" />
<Setter Property="Width"
Value="40" />
<Setter Property="Height"
Value="40" />
<Setter Property="CornerRadius"
Value="20" />
<Setter Property="CheckedCornerRadius"
Value="12,0,0,12" />
<Setter Property="Padding"
Value="10" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="VerticalAlignment"
Value="Top" />
<Setter Property="UseSystemFocusVisuals"
Value="True" />
<Setter Property="FocusVisualMargin"
Value="-3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:CircularToggleButton">
<Grid x:Name="RootGrid"
Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.25">
<VisualTransition.GeneratedEasingFunction>
<CubicEase EasingMode="EaseOut" />
</VisualTransition.GeneratedEasingFunction>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:0.25"
To="Checked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)"
Storyboard.TargetName="BackgroundVisual">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:0.25"
To="CheckedPointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)"
Storyboard.TargetName="BackgroundVisual">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:0.25"
To="CheckedPressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)"
Storyboard.TargetName="BackgroundVisual">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="1.1" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="1.1" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="1.1" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="1.1" />
<Setter Target="BackgroundVisual.Opacity"
Value="0.9" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="0.9" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="0.9" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="0.9" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="0.9" />
<Setter Target="BackgroundVisual.Opacity"
Value="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="BackgroundVisual.Opacity"
Value="0.4" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="0" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="90" />
<Setter Target="UncheckedContentPresenter.Opacity"
Value="0" />
<Setter Target="CheckedContentPresenter.Opacity"
Value="1" />
<Setter Target="BackgroundVisual.(Border.CornerRadius)"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Target="BackgroundVisual.(Border.Background).(SolidColorBrush.Color)"
Value="{Binding CheckedBackground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="CheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="UncheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPointerOver">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="1.1" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="1.1" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="1.1" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="1.1" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="0" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="90" />
<Setter Target="UncheckedContentPresenter.Opacity"
Value="0" />
<Setter Target="CheckedContentPresenter.Opacity"
Value="1" />
<Setter Target="BackgroundVisual.Opacity"
Value="0.9" />
<Setter Target="BackgroundVisual.(Border.CornerRadius)"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Target="BackgroundVisual.(Border.Background).(SolidColorBrush.Color)"
Value="{Binding CheckedBackground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="CheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="UncheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedPressed">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="0.9" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="0.9" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleX)"
Value="0.9" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.ScaleY)"
Value="0.9" />
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="0" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="90" />
<Setter Target="UncheckedContentPresenter.Opacity"
Value="0" />
<Setter Target="CheckedContentPresenter.Opacity"
Value="1" />
<Setter Target="BackgroundVisual.Opacity"
Value="1" />
<Setter Target="BackgroundVisual.(Border.CornerRadius)"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Target="BackgroundVisual.(Border.Background).(SolidColorBrush.Color)"
Value="{Binding CheckedBackground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="CheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="UncheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="CheckedDisabled">
<VisualState.Setters>
<Setter Target="CheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="0" />
<Setter Target="UncheckedContentPresenter.(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Value="90" />
<Setter Target="UncheckedContentPresenter.Opacity"
Value="0" />
<Setter Target="CheckedContentPresenter.Opacity"
Value="1" />
<Setter Target="BackgroundVisual.Opacity"
Value="0.4" />
<Setter Target="BackgroundVisual.(Border.CornerRadius)"
Value="{Binding CheckedCornerRadius, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Target="BackgroundVisual.(Border.Background).(SolidColorBrush.Color)"
Value="{Binding CheckedBackground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="CheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
<Setter Target="UncheckedContentPresenter.(ContentControl.Foreground).(SolidColorBrush.Color)"
Value="{Binding CheckedForeground.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Indeterminate" />
<VisualState x:Name="IndeterminatePointerOver" />
<VisualState x:Name="IndeterminatePressed" />
<VisualState x:Name="IndeterminateDisabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="BackgroundVisual"
Background="{TemplateBinding Background}"
Opacity="0.8"
CornerRadius="{TemplateBinding CornerRadius}" />
<ContentControl x:Name="UncheckedContentPresenter"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
RenderTransformOrigin="0.5,0.5">
<ContentControl.RenderTransform>
<CompositeTransform />
</ContentControl.RenderTransform>
</ContentControl>
<ContentControl x:Name="CheckedContentPresenter"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding CheckedContent}"
ContentTemplate="{TemplateBinding CheckedContentTemplate}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
RenderTransformOrigin="0.5,0.5"
Opacity="0">
<ContentControl.RenderTransform>
<CompositeTransform Rotation="-90" />
</ContentControl.RenderTransform>
</ContentControl>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:ExtendedButton">
<Setter Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="White" />
<Setter Property="IconForeground"
Value="White" />
<Setter Property="BorderBrush"
Value="{ThemeResource ButtonRevealBorderBrush}" />
<Setter Property="BorderThickness"
Value="{ThemeResource ButtonRevealBorderThemeThickness}" />
<Setter Property="Padding"
Value="8" />
<Setter Property="IconMargin"
Value="0,0,4,0" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="FontFamily"
Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight"
Value="SemiBold" />
<Setter Property="FontSize"
Value="12" />
<Setter Property="UseSystemFocusVisuals"
Value="True" />
<Setter Property="FocusVisualMargin"
Value="-3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:ExtendedButton">
<Grid x:Name="RootGrid"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)"
Value="PointerOver" />
<Setter Target="RootGrid.Background"
Value="{ThemeResource ButtonRevealBackgroundPointerOver}" />
<Setter Target="ContentPresenter.BorderBrush"
Value="{ThemeResource ButtonRevealBorderBrushPointerOver}" />
</VisualState.Setters>
<Storyboard>
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="RootGrid.(RevealBrush.State)"
Value="Pressed" />
<Setter Target="RootGrid.Background"
Value="{ThemeResource ButtonRevealBackgroundPressed}" />
<Setter Target="ContentPresenter.BorderBrush"
Value="{ThemeResource ButtonRevealBorderBrushPressed}" />
</VisualState.Setters>
<Storyboard>
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="RootGrid.Background"
Value="{ThemeResource ButtonRevealBackgroundDisabled}" />
<Setter Target="ContentPresenter.BorderBrush"
Value="{ThemeResource ButtonRevealBorderBrushDisabled}" />
<Setter Target="ContentPresenter.Foreground"
Value="{ThemeResource ButtonForegroundDisabled}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentControl x:Name="Icon"
Width="16"
Height="16"
Margin="{TemplateBinding IconMargin}"
Foreground="{TemplateBinding IconForeground}"
ContentTransitions="{TemplateBinding ContentTransitions}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
Style="{TemplateBinding IconStyle}" />
<ContentPresenter x:Name="ContentPresenter"
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
Grid.Column="1" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
You can’t perform that action at this time.