Update toggle to switch from graph to equations (#912)
* Modify toggle to switch from graph to equations * support RtoL languages * fix margin
This commit is contained in:
parent
9329af37f1
commit
6fe229fc15
@ -62,153 +62,227 @@
|
|||||||
<Setter Property="FocusVisualMargin" Value="-3"/>
|
<Setter Property="FocusVisualMargin" Value="-3"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="SwitchModeToggleButtonStyle" TargetType="ToggleButton">
|
<Style x:Key="GraphModeToggleSwitchStyle" TargetType="ToggleSwitch">
|
||||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
<Setter Property="Foreground" Value="{ThemeResource ToggleSwitchContentForeground}"/>
|
||||||
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
|
|
||||||
<Setter Property="BorderBrush" Value="{ThemeResource AppControlForegroundTransparentRevealBorderBrush}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
|
||||||
<Setter Property="Padding" Value="{ThemeResource ButtonPadding}"/>
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||||
<Setter Property="FontWeight" Value="Normal"/>
|
|
||||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||||
|
<Setter Property="ManipulationMode" Value="System,TranslateX"/>
|
||||||
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/>
|
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/>
|
||||||
<Setter Property="FocusVisualMargin" Value="-3"/>
|
<Setter Property="FocusVisualMargin" Value="-6,-10"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ToggleButton">
|
<ControlTemplate TargetType="ToggleSwitch">
|
||||||
<Grid x:Name="RootGrid"
|
<Grid Background="{TemplateBinding Background}"
|
||||||
Background="{TemplateBinding Background}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="CommonStates">
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
<VisualState x:Name="Normal">
|
<VisualState x:Name="Normal"/>
|
||||||
<Storyboard>
|
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
|
||||||
</Storyboard>
|
|
||||||
</VisualState>
|
|
||||||
<VisualState x:Name="PointerOver">
|
<VisualState x:Name="PointerOver">
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
|
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHoverButtonFaceBrush}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorderStroke" Storyboard.TargetProperty="Stroke">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPointerOver}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPointerOver}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPointerOver}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="Pressed">
|
<VisualState x:Name="Pressed">
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
|
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorderStroke" Storyboard.TargetProperty="Stroke">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffPressed}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffPressed}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundPressed}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="Disabled">
|
<VisualState x:Name="Disabled">
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundDisabled}"/>
|
|
||||||
<Setter Target="ContentPresenter.Opacity" Value="0.5"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
</VisualState>
|
|
||||||
<VisualState x:Name="Checked">
|
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ToggleButtonRevealBorderBrushChecked}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemAccentColor}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OuterBorderStroke" Storyboard.TargetProperty="Stroke">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchStrokeOffDisabled}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobBounds" Storyboard.TargetProperty="Fill">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchFillOffDisabled}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SwitchAreaGrid" Storyboard.TargetProperty="Background">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ToggleSwitchContainerBackgroundDisabled}"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="CheckedPointerOver">
|
</VisualStateGroup>
|
||||||
<VisualState.Setters>
|
<VisualStateGroup x:Name="ToggleStates">
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
|
<VisualStateGroup.Transitions>
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlHoverButtonFaceBrush}"/>
|
<VisualTransition x:Name="DraggingToOnTransition"
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemAccentColor}"/>
|
From="Dragging"
|
||||||
</VisualState.Setters>
|
GeneratedDuration="0"
|
||||||
|
To="On">
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOnOffset}" TargetName="SwitchKnob"/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualTransition>
|
||||||
<VisualState x:Name="CheckedPressed">
|
<VisualTransition x:Name="DraggingToOffTransition"
|
||||||
<VisualState.Setters>
|
From="Dragging"
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
|
GeneratedDuration="0"
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource AppControlPressedButtonFaceBrush}"/>
|
To="Off">
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemAccentColor}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobCurrentToOffOffset}" TargetName="SwitchKnob"/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualTransition>
|
||||||
<VisualState x:Name="CheckedDisabled">
|
<VisualTransition x:Name="OnToOffTransition"
|
||||||
<VisualState.Setters>
|
From="On"
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundDisabled}"/>
|
GeneratedDuration="0"
|
||||||
<Setter Target="ContentPresenter.Opacity" Value="0.5"/>
|
To="Off">
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource SystemAccentColor}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
</VisualState>
|
|
||||||
<VisualState x:Name="Indeterminate">
|
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundIndeterminate}"/>
|
|
||||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ToggleButtonRevealBorderBrushIndeterminate}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundIndeterminate}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOnToOffOffset}" TargetName="SwitchKnob"/>
|
||||||
|
<DoubleAnimation Duration="0:0:0.2"
|
||||||
|
Storyboard.TargetName="IconsPanelOn"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To="0"/>
|
||||||
|
<DoubleAnimation Duration="0:0:0.2"
|
||||||
|
Storyboard.TargetName="IconsPanelOff"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To="1"/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualTransition>
|
||||||
<VisualState x:Name="IndeterminatePointerOver">
|
<VisualTransition x:Name="OffToOnTransition"
|
||||||
<VisualState.Setters>
|
From="Off"
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="PointerOver"/>
|
GeneratedDuration="0"
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundIndeterminatePointerOver}"/>
|
To="On">
|
||||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ToggleButtonRevealBorderBrushIndeterminatePointerOver}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundIndeterminatePointerOver}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
|
<RepositionThemeAnimation FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.KnobOffToOnOffset}" TargetName="SwitchKnob"/>
|
||||||
|
<DoubleAnimation Duration="0:0:0.2"
|
||||||
|
Storyboard.TargetName="IconsPanelOn"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To="1"/>
|
||||||
|
<DoubleAnimation Duration="0:0:0.2"
|
||||||
|
Storyboard.TargetName="IconsPanelOff"
|
||||||
|
Storyboard.TargetProperty="Opacity"
|
||||||
|
To="0"/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualTransition>
|
||||||
<VisualState x:Name="IndeterminatePressed">
|
</VisualStateGroup.Transitions>
|
||||||
|
<VisualState x:Name="Dragging"/>
|
||||||
|
<VisualState x:Name="Off"/>
|
||||||
|
<VisualState x:Name="On">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)" Value="Pressed"/>
|
<Setter Target="KnobTranslateTransform.X" Value="32"/>
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundIndeterminatePressed}"/>
|
<Setter Target="IconsPanelOn.Opacity" Value="1"/>
|
||||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ToggleButtonRevealBorderBrushIndeterminatePressed}"/>
|
<Setter Target="IconsPanelOff.Opacity" Value="0"/>
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundIndeterminatePressed}"/>
|
|
||||||
</VisualState.Setters>
|
|
||||||
<Storyboard>
|
|
||||||
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
|
|
||||||
</Storyboard>
|
|
||||||
</VisualState>
|
|
||||||
<VisualState x:Name="IndeterminateDisabled">
|
|
||||||
<VisualState.Setters>
|
|
||||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ToggleButtonRevealBackgroundIndeterminateDisabled}"/>
|
|
||||||
<Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ToggleButtonRevealBorderBrushIndeterminateDisabled}"/>
|
|
||||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ToggleButtonForegroundIndeterminateDisabled}"/>
|
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
|
<VisualStateGroup x:Name="ContentStates">
|
||||||
|
<VisualState x:Name="OffContent"/>
|
||||||
|
<VisualState x:Name="OnContent"/>
|
||||||
|
</VisualStateGroup>
|
||||||
</VisualStateManager.VisualStateGroups>
|
</VisualStateManager.VisualStateGroups>
|
||||||
<ContentPresenter x:Name="ContentPresenter"
|
<Grid Height="30"
|
||||||
Padding="{TemplateBinding Padding}"
|
HorizontalAlignment="Left"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
VerticalAlignment="Top">
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
<Grid x:Name="SwitchAreaGrid"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
Margin="0,5"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
Background="{ThemeResource ToggleSwitchContainerBackground}"
|
||||||
AutomationProperties.AccessibilityView="Raw"
|
Control.IsTemplateFocusTarget="True"/>
|
||||||
Content="{TemplateBinding Content}"
|
<Rectangle x:Name="SwitchKnobBounds"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
Fill="{ThemeResource SwitchToggleBackground}"
|
||||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
RadiusX="4"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
RadiusY="4"/>
|
||||||
|
<Grid x:Name="SwitchKnob" HorizontalAlignment="Left">
|
||||||
|
<Rectangle Width="32"
|
||||||
|
Fill="{ThemeResource SystemAccentColor}"
|
||||||
|
RadiusX="4"
|
||||||
|
RadiusY="4"/>
|
||||||
|
<Grid.RenderTransform>
|
||||||
|
<TranslateTransform x:Name="KnobTranslateTransform"/>
|
||||||
|
</Grid.RenderTransform>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Rectangle x:Name="OuterBorderStroke"
|
||||||
|
Stroke="{ThemeResource SystemAccentColor}"
|
||||||
|
StrokeThickness="1"
|
||||||
|
IsHitTestVisible="False"
|
||||||
|
RadiusX="4"
|
||||||
|
RadiusY="4"/>
|
||||||
|
<StackPanel x:Name="IconsPanelOff"
|
||||||
|
Margin="8,0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<FontIcon x:Name="GraphIcon"
|
||||||
|
Margin="0,0,22,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="White"
|
||||||
|
FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
|
FontSize="14"
|
||||||
|
Glyph=""/>
|
||||||
|
<Grid Margin="-2,0,2,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FlowDirection="LeftToRight">
|
||||||
|
<FontIcon x:Name="EquationsIcon"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph=""/>
|
||||||
|
<TextBlock x:Name="EquationsIconX"
|
||||||
|
Margin="0,8,-1,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
FontSize="10"
|
||||||
|
FontWeight="Light"
|
||||||
|
Text="x"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel x:Name="IconsPanelOn"
|
||||||
|
Margin="8,0"
|
||||||
|
Opacity="0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<FontIcon Margin="0,0,22,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
|
FontSize="14"
|
||||||
|
Glyph=""/>
|
||||||
|
<Grid Margin="-2,0,2,0" VerticalAlignment="Center">
|
||||||
|
<FontIcon VerticalAlignment="Center"
|
||||||
|
Foreground="White"
|
||||||
|
FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph=""/>
|
||||||
|
<TextBlock Margin="0,8,-1,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Foreground="White"
|
||||||
|
FontSize="10"
|
||||||
|
FontWeight="Light"
|
||||||
|
Text="x"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
<Thumb x:Name="SwitchThumb" AutomationProperties.AccessibilityView="Raw">
|
||||||
|
<Thumb.Template>
|
||||||
|
<ControlTemplate TargetType="Thumb">
|
||||||
|
<Rectangle Fill="Transparent"/>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Thumb.Template>
|
||||||
|
</Thumb>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary x:Key="Default">
|
<ResourceDictionary x:Key="Default">
|
||||||
@ -237,6 +311,7 @@
|
|||||||
<Setter Property="CornerRadius" Value="4"/>
|
<Setter Property="CornerRadius" Value="4"/>
|
||||||
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
|
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
<SolidColorBrush x:Key="SwitchToggleBackground" Color="#40000000"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="Light">
|
<ResourceDictionary x:Key="Light">
|
||||||
<Style x:Key="ThemedSwitchModeToggleButtonStyle"
|
<Style x:Key="ThemedSwitchModeToggleButtonStyle"
|
||||||
@ -263,6 +338,7 @@
|
|||||||
<Setter Property="CornerRadius" Value="4"/>
|
<Setter Property="CornerRadius" Value="4"/>
|
||||||
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
|
<Setter Property="Background" Value="{ThemeResource SystemControlAcrylicElementBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
<SolidColorBrush x:Key="SwitchToggleBackground" Color="#60ffffff"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="HighContrast">
|
<ResourceDictionary x:Key="HighContrast">
|
||||||
<Style x:Key="ThemedSwitchModeToggleButtonStyle" TargetType="ToggleButton"/>
|
<Style x:Key="ThemedSwitchModeToggleButtonStyle" TargetType="ToggleButton"/>
|
||||||
@ -281,6 +357,7 @@
|
|||||||
<Setter Property="BorderThickness" Value="{ThemeResource ToolTipBorderThemeThickness}"/>
|
<Setter Property="BorderThickness" Value="{ThemeResource ToolTipBorderThemeThickness}"/>
|
||||||
<Setter Property="Background" Value="{ThemeResource ToolTipBackground}"/>
|
<Setter Property="Background" Value="{ThemeResource ToolTipBackground}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
<SolidColorBrush x:Key="SwitchToggleBackground" Color="{ThemeResource SystemColorWindowColor}"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</ResourceDictionary.ThemeDictionaries>
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@ -320,26 +397,23 @@
|
|||||||
</VisualStateManager.VisualStateGroups>
|
</VisualStateManager.VisualStateGroups>
|
||||||
<!-- Top panel -->
|
<!-- Top panel -->
|
||||||
<Grid Grid.ColumnSpan="2">
|
<Grid Grid.ColumnSpan="2">
|
||||||
<ToggleButton x:Name="SwitchModeToggleButton"
|
<ToggleSwitch x:Name="SwitchModeToggleButton"
|
||||||
x:Uid="SwitchModeToggleButton"
|
x:Uid="SwitchModeToggleButton"
|
||||||
Margin="0,2,4,2"
|
Margin="0,0,12,2"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Center"
|
||||||
Style="{ThemeResource ThemedSwitchModeToggleButtonStyle}"
|
Style="{StaticResource GraphModeToggleSwitchStyle}"
|
||||||
AutomationProperties.AutomationId="SwitchModeToggleButton"
|
AutomationProperties.AutomationId="SwitchModeToggleButton"
|
||||||
AutomationProperties.Name="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
AutomationProperties.Name="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsOn), Mode=OneWay}"
|
||||||
Checked="SwitchModeToggleButton_Checked"
|
Toggled="SwitchModeToggleButton_Toggled"
|
||||||
ToolTipService.ToolTip="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
ToolTipService.ToolTip="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsOn), Mode=OneWay}"
|
||||||
Unchecked="SwitchModeToggleButton_Checked"
|
Visibility="Collapsed"/>
|
||||||
Visibility="Collapsed">
|
|
||||||
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph=""/>
|
|
||||||
</ToggleButton>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- Left portion of the screen -->
|
<!-- Left portion of the screen -->
|
||||||
<Grid x:Name="LeftGrid"
|
<Grid x:Name="LeftGrid"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Padding="0,4,0,0"
|
Padding="0,4,0,0"
|
||||||
Visibility="{x:Bind ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:True), Mode=OneWay}">
|
Visibility="{x:Bind ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsOn, x:True), Mode=OneWay}">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
@ -519,7 +593,7 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}">
|
Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsOn, x:False), Mode=OneWay}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="2.2*" MaxHeight="400"/>
|
<RowDefinition Height="2.2*" MaxHeight="400"/>
|
||||||
|
@ -434,11 +434,11 @@ Platform::String ^ GraphingCalculator::GetInfoForSwitchModeToggleButton(bool isC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingCalculator::SwitchModeToggleButton_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
|
void GraphingCalculator::SwitchModeToggleButton_Toggled(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
auto narratorNotifier = ref new NarratorNotifier();
|
auto narratorNotifier = ref new NarratorNotifier();
|
||||||
String ^ announcementText;
|
String ^ announcementText;
|
||||||
if (SwitchModeToggleButton->IsChecked->Value)
|
if (SwitchModeToggleButton->IsOn)
|
||||||
{
|
{
|
||||||
announcementText = AppResourceProvider::GetInstance()->GetResourceString(L"GraphSwitchedToEquationModeAnnouncement");
|
announcementText = AppResourceProvider::GetInstance()->GetResourceString(L"GraphSwitchedToEquationModeAnnouncement");
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,6 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
void OnZoomOutCommand(Object ^ parameter);
|
void OnZoomOutCommand(Object ^ parameter);
|
||||||
void OnZoomResetCommand(Object ^ parameter);
|
void OnZoomResetCommand(Object ^ parameter);
|
||||||
|
|
||||||
double validateDouble(Platform::String ^ value, double defaultValue);
|
|
||||||
|
|
||||||
void OnShareClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void OnShareClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
|
|
||||||
void OnShowTracePopupChanged(bool newValue);
|
void OnShowTracePopupChanged(bool newValue);
|
||||||
@ -62,13 +60,11 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
Windows::ApplicationModel::DataTransfer::DataTransferManager ^ sender,
|
Windows::ApplicationModel::DataTransfer::DataTransferManager ^ sender,
|
||||||
Windows::ApplicationModel::DataTransfer::DataRequestedEventArgs ^ e);
|
Windows::ApplicationModel::DataTransfer::DataRequestedEventArgs ^ e);
|
||||||
|
|
||||||
void TextBoxGotFocus(Windows::UI::Xaml::Controls::TextBox ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
|
||||||
void GraphingControl_LostFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void GraphingControl_LostFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
void GraphingControl_LosingFocus(Windows::UI::Xaml::UIElement ^ sender, Windows::UI::Xaml::Input::LosingFocusEventArgs ^ args);
|
void GraphingControl_LosingFocus(Windows::UI::Xaml::UIElement ^ sender, Windows::UI::Xaml::Input::LosingFocusEventArgs ^ args);
|
||||||
void GraphingControl_VariablesUpdated(Platform::Object ^ sender, Object ^ args);
|
void GraphingControl_VariablesUpdated(Platform::Object ^ sender, Object ^ args);
|
||||||
void OnEquationKeyGraphFeaturesRequested(Platform::Object ^ sender, CalculatorApp::ViewModel::EquationViewModel ^ e);
|
void OnEquationKeyGraphFeaturesRequested(Platform::Object ^ sender, CalculatorApp::ViewModel::EquationViewModel ^ e);
|
||||||
void OnKeyGraphFeaturesClosed(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void OnKeyGraphFeaturesClosed(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
void SwitchModeToggleButton_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
|
||||||
void TraceValuePopup_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
void TraceValuePopup_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
||||||
void PositionGraphPopup();
|
void PositionGraphPopup();
|
||||||
void ActiveTracing_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void ActiveTracing_Checked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
@ -76,7 +72,7 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
void ActiveTracing_KeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
|
void ActiveTracing_KeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
|
||||||
void ActiveTracing_PointerCaptureLost(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
|
void ActiveTracing_PointerCaptureLost(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
|
||||||
void GraphSettingsButton_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void GraphSettingsButton_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
|
void SwitchModeToggleButton_Toggled(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
void DisplayGraphSettings();
|
void DisplayGraphSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user