Key graph features (#704)
* Added IGraphAnalyzer * Key Graph Features called and getting returned to the client. To do put all strings into the Equation object * Updated UpdateKeyGraphFeatures to add function analysis data to all properties in Equation object * Update KGF when variables are updated * Key graph features ui started * Added MathRichEditBox and started hooking up key graph features to the UI * Updated EquationViewModel to include parity and periodicity * Updated key graph features to update the EquationViewModel * updated key graph features to display more values * Key graph features populating uing MathRichEdit mode * moved KeyGraphFeatures control to GraphingCalculator.xaml * Use MathML formatting instead of MathRichEdit for strings passed back from the engine * cleaned up project targeting and equation.h comments * Updated equation edit box to populate for KeyGraphFeatures * Fixed vcxproj files to have the correct targeting and certificates. KGF Title strings moved to x:Uid instead of the code behind * Updated per PR feedback * Update MathRichEditBox to detect if the string is a mathml string and use the appropriate set method to set the text * fixed the issue where parity, periodicity and monotonicity could be set with an old value if the next one is empty * KGF control UI adjustments and error handling * Error control updates * Error handling added when analysis fails * fixed alignment on rich edit boxes * Add monotonicity direction into the mathml string and only have 1 richeditbox * Set hover state on KGF EquationEditBox to change button opacity and fixed spacing in Monotonicity RichEditBox * remove sideload package certificate info VS added * updated logic for setting error strings to be in the viewmodel * Updated KeyGraphFeatures to populate dynamically using a ListView and TemplateSelector * Update periodicity to not show if it isn't supported * Fixed issue where y-intercept was using the x-intercept value * Remove ItemsControl ItemsContainerStyle * Updated per pr feedback. Fixed bug where analysis error would not reset * Update MathRichEdit box to remove selection when focus is lost * Updated mathrichedit to get LAF access for Dev, Release and Graphing projects * Remove OnLostFocus in MathRichEdit, Change KGF ItemsControl back to ListView * Clean up styles for KGF and ensure the match the comps * Moved formatoptions logic to the Grapher constructor and reverted LineColor.Text resource that was mistakenly taken out * Add copyright header to KGF Files * fixed issue where asymptote values were not populating * Disable KGF button when there is no equation. Fixed issue where equation populated in a new equationtextbox after the previous one was deleted * Removed formatoptions testing lines used for debugging
This commit is contained in:
@@ -1140,6 +1140,244 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Name="EquationTextBoxButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid x:Name="ButtonLayoutGrid"
|
||||
Background="Transparent"
|
||||
BorderBrush="{ThemeResource TextControlButtonBorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemChromeWhiteColor}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Duration="0"
|
||||
Storyboard.TargetName="ButtonLayoutGrid"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="0"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<TextBlock x:Name="GlyphElement"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource EquationBoxHoverButtonForegroundBrush}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="12"
|
||||
FontStyle="Normal"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{TemplateBinding Content}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MathRichEdit_EquationTextBoxStyle" TargetType="Controls:MathRichEditBox">
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="ContentLinkForegroundColor" Value="{ThemeResource ContentLinkForegroundColor}"/>
|
||||
<Setter Property="ContentLinkBackgroundColor" Value="{ThemeResource ContentLinkBackgroundColor}"/>
|
||||
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
|
||||
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}"/>
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Controls:MathRichEditBox">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Normal"/>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Focused">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="RequestedTheme">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Light"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ContentPresenter x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{ThemeResource RichEditBoxTopHeaderMargin}"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{ThemeResource TextControlHeaderForeground}"
|
||||
FontWeight="Normal"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed"/>
|
||||
<Border x:Name="BorderElement"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
MinWidth="{ThemeResource TextControlThemeMinWidth}"
|
||||
MinHeight="{ThemeResource TextControlThemeMinHeight}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Control.IsTemplateFocusTarget="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
<ScrollViewer x:Name="ContentElement"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsTabStop="False"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="Disabled"/>
|
||||
<TextBlock x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"/>
|
||||
<ContentPresenter x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
|
||||
x:Load="False"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Content="{TemplateBinding Description}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="EquationTextBoxStyle" TargetType="Controls:EquationTextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0,1,1,1"/>
|
||||
@@ -1154,246 +1392,6 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Controls:EquationTextBox">
|
||||
<Grid>
|
||||
|
||||
<Grid.Resources>
|
||||
<Style x:Name="EquationTextBoxButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid x:Name="ButtonLayoutGrid"
|
||||
Background="Transparent"
|
||||
BorderBrush="{ThemeResource TextControlButtonBorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonLayoutGrid" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="GlyphElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemChromeWhiteColor}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Duration="0"
|
||||
Storyboard.TargetName="ButtonLayoutGrid"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="0"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<TextBlock x:Name="GlyphElement"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource EquationBoxHoverButtonForegroundBrush}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="12"
|
||||
FontStyle="Normal"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{TemplateBinding Content}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="EquationTextBoxStyle" TargetType="RichEditBox">
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="ContentLinkForegroundColor" Value="{ThemeResource ContentLinkForegroundColor}"/>
|
||||
<Setter Property="ContentLinkBackgroundColor" Value="{ThemeResource ContentLinkBackgroundColor}"/>
|
||||
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
|
||||
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}"/>
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RichEditBox">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
|
||||
<VisualState x:Name="Disabled">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Normal"/>
|
||||
|
||||
<VisualState x:Name="PointerOver">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Focused">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="RequestedTheme">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Light"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ContentPresenter x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{ThemeResource RichEditBoxTopHeaderMargin}"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{ThemeResource TextControlHeaderForeground}"
|
||||
FontWeight="Normal"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed"/>
|
||||
<Border x:Name="BorderElement"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
MinWidth="{ThemeResource TextControlThemeMinWidth}"
|
||||
MinHeight="{ThemeResource TextControlThemeMinHeight}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Control.IsTemplateFocusTarget="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
<ScrollViewer x:Name="ContentElement"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsTabStop="False"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="Disabled"/>
|
||||
<TextBlock x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"/>
|
||||
<ContentPresenter x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
|
||||
x:Load="False"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Content="{TemplateBinding Description}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -1479,7 +1477,6 @@
|
||||
|
||||
<VisualStateGroup x:Name="ButtonStates">
|
||||
<VisualState x:Name="ButtonVisible">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeleteButton" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
@@ -1521,19 +1518,19 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RichEditBox x:Name="EquationTextBox"
|
||||
MinHeight="44"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Stretch"
|
||||
Style="{StaticResource EquationTextBoxStyle}"
|
||||
BorderThickness="0"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
AcceptsReturn="false"
|
||||
InputScope="Text"
|
||||
MaxLength="2048"
|
||||
TextWrapping="NoWrap"/>
|
||||
<Controls:MathRichEditBox x:Name="EquationTextBox"
|
||||
MinHeight="44"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Stretch"
|
||||
Style="{StaticResource MathRichEdit_EquationTextBoxStyle}"
|
||||
BorderThickness="0"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
AcceptsReturn="false"
|
||||
InputScope="Text"
|
||||
MaxLength="2048"
|
||||
TextWrapping="NoWrap"/>
|
||||
<!-- TODO: Use brush overrides here instead of a new style, use a new style for the EquationButton above once that has more functionality -->
|
||||
<Button x:Name="DeleteButton"
|
||||
Grid.Column="3"
|
||||
@@ -1606,13 +1603,6 @@
|
||||
Visibility="Collapsed"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ContentPresenter x:Name="KeyGraphFeaturesContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Content="{TemplateBinding KeyGraphFeaturesContent}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@@ -8,8 +8,8 @@
|
||||
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">10.0.18970.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">10.0.19019.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
|
||||
<!-- We want to manually control the MinVersion/MaxVersionTested in the manifest so turn of the replacement. -->
|
||||
<AppxOSMinVersionReplaceManifestVersion>false</AppxOSMinVersionReplaceManifestVersion>
|
||||
<AppxOSMaxVersionTestedReplaceManifestVersion>false</AppxOSMaxVersionTestedReplaceManifestVersion>
|
||||
@@ -234,6 +234,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\AppLifecycleLogger.h" />
|
||||
<ClInclude Include="Controls\CalculationResultAutomationPeer.h" />
|
||||
<ClInclude Include="Controls\MathRichEditBox.h" />
|
||||
<ClInclude Include="Controls\OverflowTextBlockAutomationPeer.h" />
|
||||
<ClInclude Include="Common\AlwaysSelectedCollectionView.h" />
|
||||
<ClInclude Include="Common\BindableBase.h" />
|
||||
@@ -258,6 +259,7 @@
|
||||
<ClInclude Include="EquationStylePanelControl.xaml.h">
|
||||
<DependentUpon>EquationStylePanelControl.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.h" />
|
||||
<ClInclude Include="Views\Calculator.xaml.h">
|
||||
<DependentUpon>Views\Calculator.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
@@ -288,6 +290,9 @@
|
||||
<ClInclude Include="Views\GraphingCalculator\GraphingCalculator.xaml.h">
|
||||
<DependentUpon>Views\GraphingCalculator\GraphingCalculator.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h">
|
||||
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Views\HistoryList.xaml.h">
|
||||
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
||||
</ClInclude>
|
||||
@@ -348,6 +353,7 @@
|
||||
<Page Include="Views\DelighterUnitStyles.xaml" />
|
||||
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml" />
|
||||
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml" />
|
||||
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" />
|
||||
<Page Include="Views\HistoryList.xaml" />
|
||||
<Page Include="Views\MainPage.xaml" />
|
||||
<Page Include="Views\Memory.xaml" />
|
||||
@@ -379,6 +385,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\AppLifecycleLogger.cpp" />
|
||||
<ClCompile Include="Controls\CalculationResultAutomationPeer.cpp" />
|
||||
<ClCompile Include="Controls\MathRichEditBox.cpp" />
|
||||
<ClCompile Include="Controls\OverflowTextBlockAutomationPeer.cpp" />
|
||||
<ClCompile Include="Common\BindableBase.cpp" />
|
||||
<ClCompile Include="Controls\CalculationResult.cpp" />
|
||||
@@ -408,6 +415,7 @@
|
||||
<ClCompile Include="EquationStylePanelControl.xaml.cpp">
|
||||
<DependentUpon>EquationStylePanelControl.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.cpp" />
|
||||
<ClCompile Include="Views\Calculator.xaml.cpp">
|
||||
<DependentUpon>Views\Calculator.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
@@ -438,6 +446,9 @@
|
||||
<ClCompile Include="Views\GraphingCalculator\GraphingCalculator.xaml.cpp">
|
||||
<DependentUpon>Views\GraphingCalculator\GraphingCalculator.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp">
|
||||
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Views\HistoryList.xaml.cpp">
|
||||
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
|
||||
</ClCompile>
|
||||
@@ -850,4 +861,4 @@
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@@ -307,6 +307,9 @@
|
||||
<ClCompile Include="Controls\EquationTextBox.cpp">
|
||||
<Filter>Controls</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Controls\MathRichEditBox.cpp" />
|
||||
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp" />
|
||||
<ClCompile Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
@@ -393,6 +396,9 @@
|
||||
<ClInclude Include="Controls\EquationTextBox.h">
|
||||
<Filter>Controls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Controls\MathRichEditBox.h" />
|
||||
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h" />
|
||||
<ClInclude Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
@@ -470,6 +476,7 @@
|
||||
<Page Include="EquationStylePanelControl.xaml">
|
||||
<Filter>Views\GraphingCalculator</Filter>
|
||||
</Page>
|
||||
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Resources\en-US\CEngineStrings.resw">
|
||||
|
@@ -20,13 +20,12 @@ using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, EquationColor);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, KeyGraphFeaturesContent);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, ColorChooserFlyout);
|
||||
|
||||
void EquationTextBox::OnApplyTemplate()
|
||||
{
|
||||
m_equationButton = dynamic_cast<Button ^>(GetTemplateChild("EquationButton"));
|
||||
m_richEditBox = dynamic_cast<RichEditBox ^>(GetTemplateChild("EquationTextBox"));
|
||||
m_richEditBox = dynamic_cast<MathRichEditBox ^>(GetTemplateChild("EquationTextBox"));
|
||||
m_deleteButton = dynamic_cast<Button ^>(GetTemplateChild("DeleteButton"));
|
||||
m_removeButton = dynamic_cast<Button ^>(GetTemplateChild("RemoveButton"));
|
||||
m_functionButton = dynamic_cast<Button ^>(GetTemplateChild("FunctionButton"));
|
||||
@@ -34,7 +33,6 @@ void EquationTextBox::OnApplyTemplate()
|
||||
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
m_richEditBox->Loaded += ref new RoutedEventHandler(this, &EquationTextBox::OnRichEditBoxLoaded);
|
||||
m_richEditBox->GotFocus += ref new RoutedEventHandler(this, &EquationTextBox::OnRichEditBoxGotFocus);
|
||||
m_richEditBox->LostFocus += ref new RoutedEventHandler(this, &EquationTextBox::OnRichEditBoxLostFocus);
|
||||
m_richEditBox->TextChanged += ref new RoutedEventHandler(this, &EquationTextBox::OnRichEditBoxTextChanged);
|
||||
@@ -64,6 +62,7 @@ void EquationTextBox::OnApplyTemplate()
|
||||
if (m_functionButton != nullptr)
|
||||
{
|
||||
m_functionButton->Click += ref new RoutedEventHandler(this, &EquationTextBox::OnFunctionButtonClicked);
|
||||
m_functionButton->IsEnabled = false;
|
||||
}
|
||||
|
||||
if (ColorChooserFlyout != nullptr)
|
||||
@@ -104,6 +103,10 @@ void EquationTextBox::OnKeyDown(KeyRoutedEventArgs ^ e)
|
||||
if (e->Key == VirtualKey::Enter)
|
||||
{
|
||||
EquationSubmitted(this, ref new RoutedEventArgs());
|
||||
if (m_functionButton && m_richEditBox->MathText != L"")
|
||||
{
|
||||
m_functionButton->IsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +115,10 @@ void EquationTextBox::OnLostFocus(RoutedEventArgs ^ e)
|
||||
if (!m_richEditBox->ContextFlyout->IsOpen)
|
||||
{
|
||||
EquationSubmitted(this, ref new RoutedEventArgs());
|
||||
if (m_functionButton && m_richEditBox->MathText != L"")
|
||||
{
|
||||
m_functionButton->IsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,15 +135,6 @@ void EquationTextBox::OnColorFlyoutClosed(Object ^ sender, Object ^ e)
|
||||
UpdateCommonVisualState();
|
||||
}
|
||||
|
||||
void EquationTextBox::OnRichEditBoxLoaded(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
LimitedAccessFeatures::TryUnlockFeature(
|
||||
"com.microsoft.windows.richeditmath",
|
||||
"H6wflFFz3gkOsAHtG/D9Tg==",
|
||||
"8wekyb3d8bbwe has registered their use of com.microsoft.windows.richeditmath with Microsoft and agrees to the terms of use.");
|
||||
m_richEditBox->TextDocument->SetMathMode(::RichEditMathMode::MathOnly);
|
||||
}
|
||||
|
||||
void EquationTextBox::OnRichEditBoxTextChanged(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
UpdateDeleteButtonVisualState();
|
||||
@@ -163,17 +161,32 @@ void EquationTextBox::OnDeleteButtonClicked(Object ^ sender, RoutedEventArgs ^ e
|
||||
{
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
m_richEditBox->TextDocument->SetMath(L"");
|
||||
m_richEditBox->MathText = L"";
|
||||
if (m_functionButton)
|
||||
{
|
||||
m_functionButton->IsEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EquationTextBox::OnEquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
EquationButtonClicked(this, ref new RoutedEventArgs());
|
||||
}
|
||||
|
||||
void EquationTextBox::OnRemoveButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
m_richEditBox->MathText = L"";
|
||||
}
|
||||
|
||||
RemoveButtonClicked(this, ref new RoutedEventArgs());
|
||||
|
||||
if (m_functionButton)
|
||||
{
|
||||
m_functionButton->IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void EquationTextBox::OnColorChooserButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
@@ -186,10 +199,7 @@ void EquationTextBox::OnColorChooserButtonClicked(Object ^ sender, RoutedEventAr
|
||||
|
||||
void EquationTextBox::OnFunctionButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
auto equationViewModel = static_cast<EquationViewModel ^>(DataContext);
|
||||
equationViewModel->KeyGraphFeaturesVisibility =
|
||||
(equationViewModel->KeyGraphFeaturesVisibility == ::Visibility::Collapsed) ? ::Visibility::Visible : ::Visibility::Collapsed;
|
||||
UpdateCommonVisualState();
|
||||
KeyGraphFeaturesButtonClicked(this, ref new RoutedEventArgs());
|
||||
}
|
||||
|
||||
void EquationTextBox::UpdateDeleteButtonVisualState()
|
||||
@@ -239,7 +249,7 @@ Platform::String ^ EquationTextBox::GetEquationText()
|
||||
range->CharacterFormat->Underline = UnderlineType::None;
|
||||
}
|
||||
|
||||
m_richEditBox->TextDocument->GetMath(&text);
|
||||
text = m_richEditBox->MathText;
|
||||
}
|
||||
|
||||
return text;
|
||||
@@ -249,7 +259,7 @@ void EquationTextBox::SetEquationText(Platform::String ^ equationText)
|
||||
{
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
m_richEditBox->TextDocument->SetMath(equationText);
|
||||
m_richEditBox->MathText = equationText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +269,7 @@ bool EquationTextBox::ShouldDeleteButtonBeVisible()
|
||||
|
||||
if (m_richEditBox != nullptr)
|
||||
{
|
||||
m_richEditBox->TextDocument->GetMath(&text);
|
||||
text = m_richEditBox->MathText;
|
||||
}
|
||||
return (!text->IsEmpty() && m_isFocused);
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "CalcViewModel/Common/Utils.h"
|
||||
#include "CalcViewModel/GraphingCalculator/EquationViewModel.h"
|
||||
#include "Calculator/Controls/MathRichEditBox.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -19,11 +20,12 @@ namespace CalculatorApp
|
||||
|
||||
DEPENDENCY_PROPERTY_OWNER(EquationTextBox);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::SolidColorBrush^, EquationColor);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::UIElement^, KeyGraphFeaturesContent);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Controls::Flyout^, ColorChooserFlyout);
|
||||
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ RemoveButtonClicked;
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ KeyGraphFeaturesButtonClicked;
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ EquationSubmitted;
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ EquationButtonClicked;
|
||||
|
||||
Platform::String^ GetEquationText();
|
||||
void SetEquationText(Platform::String^ equationText);
|
||||
@@ -42,10 +44,8 @@ namespace CalculatorApp
|
||||
void UpdateDeleteButtonVisualState();
|
||||
bool ShouldDeleteButtonBeVisible();
|
||||
|
||||
void OnRichEditBoxLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void OnRichEditBoxGotFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void OnRichEditBoxLostFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void OnRichEditBoxLosingFocus(Windows::UI::Xaml::UIElement ^ sender, Windows::UI::Xaml::Input::LosingFocusEventArgs ^ e);
|
||||
void OnRichEditBoxTextChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
|
||||
void OnDeleteButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
@@ -57,7 +57,7 @@ namespace CalculatorApp
|
||||
void OnColorFlyoutOpened(Platform::Object^ sender, Platform::Object^ e);
|
||||
void OnColorFlyoutClosed(Platform::Object^ sender, Platform::Object^ e);
|
||||
|
||||
Windows::UI::Xaml::Controls::RichEditBox^ m_richEditBox;
|
||||
CalculatorApp::Controls::MathRichEditBox^ m_richEditBox;
|
||||
Windows::UI::Xaml::Controls::Button^ m_equationButton;
|
||||
Windows::UI::Xaml::Controls::Button^ m_deleteButton;
|
||||
Windows::UI::Xaml::Controls::Button^ m_removeButton;
|
||||
|
66
src/Calculator/Controls/MathRichEditBox.cpp
Normal file
66
src/Calculator/Controls/MathRichEditBox.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "MathRichEditBox.h"
|
||||
|
||||
using namespace Platform;
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::Common;
|
||||
using namespace CalculatorApp::Controls;
|
||||
using namespace std;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(MathRichEditBox, MathText);
|
||||
|
||||
MathRichEditBox::MathRichEditBox()
|
||||
{
|
||||
static LimitedAccessFeatureStatus m_lafResultStatus;
|
||||
String ^ packageName = Package::Current->Id->Name;
|
||||
|
||||
if (packageName == L"Microsoft.WindowsCalculator.Dev")
|
||||
{
|
||||
m_lafResultStatus = LimitedAccessFeatures::TryUnlockFeature(
|
||||
"com.microsoft.windows.richeditmath",
|
||||
"BeDD/jxKhz/yfVNA11t4uA==", // Microsoft.WindowsCalculator.Dev
|
||||
"8wekyb3d8bbwe has registered their use of com.microsoft.windows.richeditmath with Microsoft and agrees to the terms of use.")->Status;
|
||||
}
|
||||
|
||||
else if (packageName == L"Microsoft.WindowsCalculator")
|
||||
{
|
||||
m_lafResultStatus = LimitedAccessFeatures::TryUnlockFeature(
|
||||
"com.microsoft.windows.richeditmath",
|
||||
"pfanNuxnzo+mAkBQ3N/rGQ==", // Microsoft.WindowsCalculator
|
||||
"8wekyb3d8bbwe has registered their use of com.microsoft.windows.richeditmath with Microsoft and agrees to the terms of use.")->Status;
|
||||
}
|
||||
|
||||
else if (packageName == L"Microsoft.WindowsCalculator.Graphing")
|
||||
{
|
||||
m_lafResultStatus = LimitedAccessFeatures::TryUnlockFeature(
|
||||
"com.microsoft.windows.richeditmath",
|
||||
"H6wflFFz3gkOsAHtG/D9Tg==", // Microsoft.WindowsCalculator.Graphing
|
||||
"8wekyb3d8bbwe has registered their use of com.microsoft.windows.richeditmath with Microsoft and agrees to the terms of use.")->Status;
|
||||
}
|
||||
|
||||
TextDocument->SetMathMode(Windows::UI::Text::RichEditMathMode::MathOnly);
|
||||
}
|
||||
|
||||
String ^ MathRichEditBox::GetMathTextProperty()
|
||||
{
|
||||
String ^ text;
|
||||
this->TextDocument->GetMath(&text);
|
||||
return text;
|
||||
}
|
||||
|
||||
void MathRichEditBox::SetMathTextProperty(String ^ newValue)
|
||||
{
|
||||
bool readOnlyState = this->IsReadOnly;
|
||||
this->IsReadOnly = false;
|
||||
|
||||
TextDocument->SetMath(newValue);
|
||||
|
||||
this->IsReadOnly = readOnlyState;
|
||||
}
|
49
src/Calculator/Controls/MathRichEditBox.h
Normal file
49
src/Calculator/Controls/MathRichEditBox.h
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
#include "CalcViewModel/Common/Utils.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace Controls
|
||||
{
|
||||
public
|
||||
ref class MathRichEditBox sealed : Windows::UI::Xaml::Controls::RichEditBox
|
||||
{
|
||||
public:
|
||||
MathRichEditBox();
|
||||
|
||||
DEPENDENCY_PROPERTY_OWNER(MathRichEditBox);
|
||||
|
||||
static property Windows::UI::Xaml::DependencyProperty ^ MathTextProperty
|
||||
{
|
||||
Windows::UI::Xaml::DependencyProperty ^ get() {
|
||||
return s_MathTextProperty;
|
||||
}
|
||||
}
|
||||
property Platform::String ^ MathText
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return GetMathTextProperty();
|
||||
}
|
||||
void set(Platform::String^ value)
|
||||
{
|
||||
SetMathTextProperty(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private :
|
||||
Platform::String ^ GetMathTextProperty();
|
||||
void SetMathTextProperty(Platform::String ^ newValue);
|
||||
|
||||
static Windows::UI::Xaml::DependencyProperty ^ s_MathTextProperty;
|
||||
static Windows::UI::Xaml::DependencyProperty ^ InitializeMathTextProperty()
|
||||
{
|
||||
return Utils::RegisterDependencyProperty<DependencyPropertiesOwner, Platform::String ^>(L"MathText");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp">
|
||||
<Identity Name="Microsoft.WindowsCalculator.Graphing" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="0.0.0.0" />
|
||||
<Identity Name="Microsoft.WindowsCalculator.Graphing" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="0.0.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="b58171c6-c70c-4266-a2e8-8f9c994f4456" PhonePublisherId="95d94207-0c7c-47ed-82db-d75c81153c35" />
|
||||
<Properties>
|
||||
<DisplayName>ms-resource:DevAppStoreName</DisplayName>
|
||||
|
@@ -549,11 +549,11 @@
|
||||
<value>%1, value %2</value>
|
||||
<comment>{Locked="%1","%2"}. String used in automation name for each bit in bit flip. %1 will be replaced by the position of the bit (1st bit, 3rd bit), %2 by a binary value (1 or 0)</comment>
|
||||
</data>
|
||||
<data name="BitPosition" xml:space="preserve">
|
||||
<data name="BitPosition" xml:space="preserve">
|
||||
<value>%1 bit</value>
|
||||
<comment>{Locked="%1"}. Sub-string used to indicate the position of a bit (e.g. 1st bit, 2nd bit...)</comment>
|
||||
</data>
|
||||
<data name="63" xml:space="preserve">
|
||||
<data name="63" xml:space="preserve">
|
||||
<value>63rd</value>
|
||||
<comment>Sub-string used in automation name for 63 bit in bit flip</comment>
|
||||
</data>
|
||||
@@ -3531,4 +3531,163 @@
|
||||
<value>Line Color</value>
|
||||
<comment>Label for the Line Color section of the style picker</comment>
|
||||
</data>
|
||||
<data name="KeyGraphFeaturesLabel.Text" xml:space="preserve">
|
||||
<value>Key Graph Features</value>
|
||||
<comment>Title for KeyGraphFeatures Control</comment>
|
||||
</data>
|
||||
<data name="KGFHorizontalAsymptotesNone" xml:space="preserve">
|
||||
<value>The function does not have any horizontal asymptotes.</value>
|
||||
<comment>Message displayed when the graph does not have any horizontal asymptotes</comment>
|
||||
</data>
|
||||
<data name="KGFInflectionPointsNone" xml:space="preserve">
|
||||
<value>The function does not have any inflection points.</value>
|
||||
<comment>Message displayed when the graph does not have any inflection points</comment>
|
||||
</data>
|
||||
<data name="KGFMaximaNone" xml:space="preserve">
|
||||
<value>The function does not have any maxima points.</value>
|
||||
<comment>Message displayed when the graph does not have any maxima</comment>
|
||||
</data>
|
||||
<data name="KGFMinimaNone" xml:space="preserve">
|
||||
<value>The function does not have any minima points.</value>
|
||||
<comment>Message displayed when the graph does not have any minima</comment>
|
||||
</data>
|
||||
<data name="KGFMonotonicityConstant" xml:space="preserve">
|
||||
<value>Constant</value>
|
||||
<comment>String describing constant monotonicity of a function</comment>
|
||||
</data>
|
||||
<data name="KGFMonotonicityDecreasing" xml:space="preserve">
|
||||
<value>Decreasing</value>
|
||||
<comment>String describing decreasing monotonicity of a function</comment>
|
||||
</data>
|
||||
<data name="KGFMonotonicityError" xml:space="preserve">
|
||||
<value>Unable to determine the monotonicity of the function.</value>
|
||||
<comment>Error displayed when monotonicity cannot be determined</comment>
|
||||
</data>
|
||||
<data name="KGFMonotonicityIncreasing" xml:space="preserve">
|
||||
<value>Increasing</value>
|
||||
<comment>String describing increasing monotonicity of a function</comment>
|
||||
</data>
|
||||
<data name="KGFMonotonicityUnknown" xml:space="preserve">
|
||||
<value>The monotonicity of the function is unknown.</value>
|
||||
<comment>Error displayed when monotonicity is unknown</comment>
|
||||
</data>
|
||||
<data name="KGFObliqueAsymptotesNone" xml:space="preserve">
|
||||
<value>The function does not have any oblique aysmptotes.</value>
|
||||
<comment>Message displayed when the graph does not have any oblique asymptotes</comment>
|
||||
</data>
|
||||
<data name="KGFParityError" xml:space="preserve">
|
||||
<value>Unable to determine the parity of the function.</value>
|
||||
<comment>Error displayed when parity is cannot be determined</comment>
|
||||
</data>
|
||||
<data name="KGFParityEven" xml:space="preserve">
|
||||
<value>The function is even.</value>
|
||||
<comment>Message displayed with the function parity is even</comment>
|
||||
</data>
|
||||
<data name="KGFParityNeither" xml:space="preserve">
|
||||
<value>The function is neither even nor odd.</value>
|
||||
<comment>Message displayed with the function parity is neither even nor odd</comment>
|
||||
</data>
|
||||
<data name="KGFParityOdd" xml:space="preserve">
|
||||
<value>The function is odd.</value>
|
||||
<comment>Message displayed with the function parity is odd</comment>
|
||||
</data>
|
||||
<data name="KGFParityUnknown" xml:space="preserve">
|
||||
<value>The function parity is unknown.</value>
|
||||
<comment>Error displayed when parity is unknown</comment>
|
||||
</data>
|
||||
<data name="KGFPeriodicityError" xml:space="preserve">
|
||||
<value>Periodicity is not supported for this function.</value>
|
||||
<comment>Error displayed when periodicity is not supported</comment>
|
||||
</data>
|
||||
<data name="KGFPeriodicityNotPeriodic" xml:space="preserve">
|
||||
<value>The function is not periodic.</value>
|
||||
<comment>Message displayed with the function periodicity is not periodic</comment>
|
||||
</data>
|
||||
<data name="KGFPeriodicityUnknown" xml:space="preserve">
|
||||
<value>The function periodicity is unknown.</value>
|
||||
<comment>Message displayed with the function periodicity is unknown</comment>
|
||||
</data>
|
||||
<data name="KGFTooComplexFeaturesError" xml:space="preserve">
|
||||
<value>These features are too complex for Calculator to calculate:</value>
|
||||
<comment>Error displayed when analysis features cannot be calculated</comment>
|
||||
</data>
|
||||
<data name="KGFVerticalAsymptotesNone" xml:space="preserve">
|
||||
<value>The function does not have any vertical asymptotes.</value>
|
||||
<comment>Message displayed when the graph does not have any vertical asymptotes</comment>
|
||||
</data>
|
||||
<data name="KGFXInterceptNone" xml:space="preserve">
|
||||
<value>The function does not have any x-intercepts.</value>
|
||||
<comment>Message displayed when the graph does not have any x-intercepts</comment>
|
||||
</data>
|
||||
<data name="KGFYInterceptNone" xml:space="preserve">
|
||||
<value>The function does not have any y-intercepts.</value>
|
||||
<comment>Message displayed when the graph does not have any y-intercepts</comment>
|
||||
</data>
|
||||
<data name="Domain" xml:space="preserve">
|
||||
<value>Domain</value>
|
||||
<comment>Title for KeyGraphFeatures Domain Property</comment>
|
||||
</data>
|
||||
<data name="HorizontalAsymptotes" xml:space="preserve">
|
||||
<value>Horizontal Asymptotes</value>
|
||||
<comment>Title for KeyGraphFeatures Horizontal Aysmptotes Property</comment>
|
||||
</data>
|
||||
<data name="InflectionPoints" xml:space="preserve">
|
||||
<value>Inflection Points</value>
|
||||
<comment>Title for KeyGraphFeatures Inflection Points Property</comment>
|
||||
</data>
|
||||
<data name="KGFAnalysisNotSupported" xml:space="preserve">
|
||||
<value>Analysis is not supported for this function.</value>
|
||||
<comment>Error displayed when graph analysis is not supported or had an error.</comment>
|
||||
</data>
|
||||
<data name="Maxima" xml:space="preserve">
|
||||
<value>Maxima</value>
|
||||
<comment>Title for KeyGraphFeatures Maxima Property</comment>
|
||||
</data>
|
||||
<data name="Minima" xml:space="preserve">
|
||||
<value>Minima</value>
|
||||
<comment>Title for KeyGraphFeatures Minima Property</comment>
|
||||
</data>
|
||||
<data name="Monotonicity" xml:space="preserve">
|
||||
<value>Monotonicity</value>
|
||||
<comment>Title for KeyGraphFeatures Monotonicity Property</comment>
|
||||
</data>
|
||||
<data name="ObliqueAsymptotes" xml:space="preserve">
|
||||
<value>Oblique Asymptotes</value>
|
||||
<comment>Title for KeyGraphFeatures Oblique Asymptotes Property</comment>
|
||||
</data>
|
||||
<data name="Parity" xml:space="preserve">
|
||||
<value>Parity</value>
|
||||
<comment>Title for KeyGraphFeatures Parity Property</comment>
|
||||
</data>
|
||||
<data name="Periodicity" xml:space="preserve">
|
||||
<value>Period</value>
|
||||
<comment>Title for KeyGraphFeatures Periodicity Property</comment>
|
||||
</data>
|
||||
<data name="Range" xml:space="preserve">
|
||||
<value>Range</value>
|
||||
<comment>Title for KeyGraphFeatures Range Property</comment>
|
||||
</data>
|
||||
<data name="VerticalAsymptotes" xml:space="preserve">
|
||||
<value>Vertical Asymptotes</value>
|
||||
<comment>Title for KeyGraphFeatures Vertical Asymptotes Property</comment>
|
||||
</data>
|
||||
<data name="XIntercept" xml:space="preserve">
|
||||
<value>X Intercept</value>
|
||||
<comment>Title for KeyGraphFeatures XIntercept Property</comment>
|
||||
</data>
|
||||
<data name="YIntercept" xml:space="preserve">
|
||||
<value>Y Intercept</value>
|
||||
<comment>Title for KeyGraphFeatures YIntercept Property</comment>
|
||||
</data>
|
||||
<data name="KGFAnalysisCouldNotBePerformed" xml:space="preserve">
|
||||
<value>Analysis could not be performed for the function.</value>
|
||||
</data>
|
||||
<data name="KGFDomainNone" xml:space="preserve">
|
||||
<value>Unable to calculate the domain for this function.</value>
|
||||
<comment>Error displayed when Domain is not returned from the analyzer.</comment>
|
||||
</data>
|
||||
<data name="KGFRangeNone" xml:space="preserve">
|
||||
<value>Unable to calculate the range for this function.</value>
|
||||
<comment>Error displayed when Range is not returned from the analyzer.</comment>
|
||||
</data>
|
||||
</root>
|
||||
|
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "KeyGraphFeaturesTemplateSelector.h"
|
||||
#include "CalcViewModel/GraphingCalculator/EquationViewModel.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::TemplateSelectors;
|
||||
using namespace Platform;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
|
||||
DataTemplate ^ KeyGraphFeaturesTemplateSelector::SelectTemplateCore(Object ^ item)
|
||||
{
|
||||
auto kgfItem = static_cast<KeyGraphFeaturesItem ^>(item);
|
||||
|
||||
if (!kgfItem->IsText)
|
||||
{
|
||||
if (kgfItem->DisplayItems->Size != 0)
|
||||
{
|
||||
return RichEditTemplate;
|
||||
}
|
||||
else if (kgfItem->GridItems->Size != 0)
|
||||
{
|
||||
return GridTemplate;
|
||||
}
|
||||
}
|
||||
|
||||
return TextBlockTemplate;
|
||||
}
|
||||
|
||||
DataTemplate ^ KeyGraphFeaturesTemplateSelector::SelectTemplateCore(Object ^ item, DependencyObject ^ container)
|
||||
{
|
||||
return SelectTemplateCore(item);
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace TemplateSelectors
|
||||
{
|
||||
public
|
||||
ref class KeyGraphFeaturesTemplateSelector sealed : Windows::UI::Xaml::Controls::DataTemplateSelector
|
||||
{
|
||||
public:
|
||||
KeyGraphFeaturesTemplateSelector()
|
||||
{
|
||||
}
|
||||
|
||||
property Windows::UI::Xaml::DataTemplate ^ RichEditTemplate;
|
||||
property Windows::UI::Xaml::DataTemplate ^ GridTemplate;
|
||||
property Windows::UI::Xaml::DataTemplate ^ TextBlockTemplate;
|
||||
|
||||
Windows::UI::Xaml::DataTemplate ^ SelectTemplateCore(Platform::Object ^ item) override;
|
||||
Windows::UI::Xaml::DataTemplate ^ SelectTemplateCore(Platform::Object ^ item, Windows::UI::Xaml::DependencyObject ^ container) override;
|
||||
};
|
||||
}
|
||||
}
|
@@ -111,26 +111,42 @@
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundDisabled" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonForeground" Color="#99000000"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver" Color="{ThemeResource SystemAccentColor}" Opacity="0.8"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed" Color="{ThemeResource SystemAccentColor}" Opacity="1.0"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver"
|
||||
Opacity="0.8"
|
||||
Color="{ThemeResource SystemAccentColor}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed"
|
||||
Opacity="1.0"
|
||||
Color="{ThemeResource SystemAccentColor}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundDisabled" Color="#33000000"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundDisabled" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonForeground" Color="{ThemeResource SystemColorWindowTextColor}" Opacity="0.6"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver" Color="{ThemeResource SystemColorHighlightColor}" Opacity="0.8"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed" Color="{ThemeResource SystemColorHighlightColor}" Opacity="1.0"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundDisabled" Color="{ThemeResource SystemColorGrayTextColor}" Opacity="0.2"/>
|
||||
<SolidColorBrush x:Key="ButtonForeground"
|
||||
Opacity="0.6"
|
||||
Color="{ThemeResource SystemColorWindowTextColor}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver"
|
||||
Opacity="0.8"
|
||||
Color="{ThemeResource SystemColorHighlightColor}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed"
|
||||
Opacity="1.0"
|
||||
Color="{ThemeResource SystemColorHighlightColor}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundDisabled"
|
||||
Opacity="0.2"
|
||||
Color="{ThemeResource SystemColorGrayTextColor}"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonBackgroundDisabled" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ButtonForeground" Color="#99FFFFFF"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver" Color="{ThemeResource SystemAccentColorLight1}" Opacity="0.8"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed" Color="{ThemeResource SystemAccentColorLight1}" Opacity="1.0"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPointerOver"
|
||||
Opacity="0.8"
|
||||
Color="{ThemeResource SystemAccentColorLight1}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundPressed"
|
||||
Opacity="1.0"
|
||||
Color="{ThemeResource SystemAccentColorLight1}"/>
|
||||
<SolidColorBrush x:Key="ButtonForegroundDisabled" Color="#33FFFFFF"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
@@ -149,41 +165,39 @@
|
||||
Style="{StaticResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Control">
|
||||
<TextBlock x:Name="EditableToken"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{Binding DisplayValue, Mode=OneWay}"
|
||||
Grid.Row="2"
|
||||
Margin="4,0,4,0"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
FontWeight="SemiBold"
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Right"/>
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{Binding DisplayValue, Mode=OneWay}"/>
|
||||
</ScrollViewer>
|
||||
<Border Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
|
||||
Grid.Column="0">
|
||||
<Border Grid.Column="0" Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}">
|
||||
<Button x:Name="ScrollLeft"
|
||||
x:Uid="scrollLeft"
|
||||
Margin="0,3,0,0"
|
||||
Style="{StaticResource AlwaysOnTopScrollButtonStyleS}"
|
||||
MinWidth="{TemplateBinding ColumnWidth}"
|
||||
MinHeight="{TemplateBinding ColumnHeight}"
|
||||
Background="Transparent">
|
||||
x:Uid="scrollLeft"
|
||||
MinWidth="{TemplateBinding ColumnWidth}"
|
||||
MinHeight="{TemplateBinding ColumnHeight}"
|
||||
Margin="0,3,0,0"
|
||||
Style="{StaticResource AlwaysOnTopScrollButtonStyleS}"
|
||||
Background="Transparent">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="{TemplateBinding ScrollButtonFontSize}"
|
||||
Glyph=""/>
|
||||
FontSize="{TemplateBinding ScrollButtonFontSize}"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
</Border>
|
||||
<Border Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
|
||||
Grid.Column="2">
|
||||
<Border Grid.Column="2" Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}">
|
||||
<Button x:Name="ScrollRight"
|
||||
x:Uid="scrollRight"
|
||||
Margin="0,3,0,0"
|
||||
Style="{StaticResource AlwaysOnTopScrollButtonStyleS}"
|
||||
MinWidth="{TemplateBinding ColumnWidth}"
|
||||
MinHeight="{TemplateBinding ColumnHeight}"
|
||||
Background="Transparent">
|
||||
x:Uid="scrollRight"
|
||||
MinWidth="{TemplateBinding ColumnWidth}"
|
||||
MinHeight="{TemplateBinding ColumnHeight}"
|
||||
Margin="0,3,0,0"
|
||||
Style="{StaticResource AlwaysOnTopScrollButtonStyleS}"
|
||||
Background="Transparent">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="{TemplateBinding ScrollButtonFontSize}"
|
||||
Glyph=""/>
|
||||
FontSize="{TemplateBinding ScrollButtonFontSize}"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -192,7 +206,9 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="AlwaysOnTopStyleM" BasedOn="{StaticResource AlwaysOnTopStyleS}" TargetType="controls:OverflowTextBlock">
|
||||
<Style x:Key="AlwaysOnTopStyleM"
|
||||
BasedOn="{StaticResource AlwaysOnTopStyleS}"
|
||||
TargetType="controls:OverflowTextBlock">
|
||||
<Setter Property="ColumnWidth" Value="28"/>
|
||||
<Setter Property="ColumnHeight" Value="280"/>
|
||||
<Setter Property="ScrollButtonFontSize" Value="28"/>
|
||||
@@ -223,7 +239,7 @@
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="AlwaysOnTopScrollButtonStyleS" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="0,0,0,0"/>
|
||||
@@ -592,8 +608,8 @@
|
||||
<controls:OverflowTextBlock x:Name="ExpressionText"
|
||||
Grid.Row="1"
|
||||
Margin="6,0,6,0"
|
||||
Style="{StaticResource NormalStyle}"
|
||||
VerticalAlignment="Bottom"
|
||||
Style="{StaticResource NormalStyle}"
|
||||
AutomationProperties.AutomationId="CalculatorExpression"
|
||||
AutomationProperties.Name="{x:Bind Model.CalculationExpressionAutomationName, Mode=OneWay}"
|
||||
IsTabStop="False"
|
||||
@@ -620,12 +636,12 @@
|
||||
x:Uid="CalculatorAlwaysOnTopResults"
|
||||
Grid.Row="2"
|
||||
Margin="6,0,6,0"
|
||||
HorizontalContentAlignment="Right"
|
||||
AutomationProperties.AutomationId="CalculatorAlwaysOnTopResults"
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
AutomationProperties.Name="{x:Bind Model.CalculationResultAutomationName, Mode=OneWay}"
|
||||
TokensUpdated="{x:Bind Model.AreAlwaysOnTopResultsUpdated, Mode=OneWay}"
|
||||
HorizontalContentAlignment="Right"
|
||||
IsActive="True"
|
||||
TokensUpdated="{x:Bind Model.AreAlwaysOnTopResultsUpdated, Mode=OneWay}"
|
||||
UseSystemFocusVisuals="True"
|
||||
Visibility="{x:Bind Model.IsAlwaysOnTop, Mode=OneWay}"/>
|
||||
|
||||
@@ -644,18 +660,17 @@
|
||||
TabIndex="7"
|
||||
Visibility="{x:Bind Model.IsProgrammer, Mode=OneWay}"/>
|
||||
|
||||
<Grid x:Name="HistoryButtonParent"
|
||||
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Grid x:Name="HistoryButtonParent" Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Button x:Name="HistoryButton"
|
||||
x:Uid="HistoryButton"
|
||||
Grid.Row="0"
|
||||
IsEnabled="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}"
|
||||
Style="{StaticResource HistoryButtonStyle}"
|
||||
AutomationProperties.AutomationId="HistoryButton"
|
||||
Command="{x:Bind HistoryButtonPressed, Mode=OneTime}"
|
||||
Content=""
|
||||
ExitDisplayModeOnAccessKeyInvoked="False"
|
||||
TabIndex="2">
|
||||
x:Uid="HistoryButton"
|
||||
Grid.Row="0"
|
||||
Style="{StaticResource HistoryButtonStyle}"
|
||||
AutomationProperties.AutomationId="HistoryButton"
|
||||
Command="{x:Bind HistoryButtonPressed, Mode=OneTime}"
|
||||
Content=""
|
||||
ExitDisplayModeOnAccessKeyInvoked="False"
|
||||
IsEnabled="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}"
|
||||
TabIndex="2">
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout x:Name="HistoryFlyout"
|
||||
AutomationProperties.AutomationId="HistoryFlyout"
|
||||
@@ -666,7 +681,7 @@
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
|
||||
<!-- Scientific angle buttons -->
|
||||
<local:CalculatorScientificAngleButtons x:Name="ScientificAngleButtons"
|
||||
Grid.Row="3"
|
||||
@@ -680,8 +695,8 @@
|
||||
x:Uid="MemoryPanel"
|
||||
Grid.Row="4"
|
||||
Margin="3,0,3,0"
|
||||
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"
|
||||
AutomationProperties.HeadingLevel="Level1">
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" MaxWidth="80"/>
|
||||
<ColumnDefinition Width="1*" MaxWidth="80"/>
|
||||
|
@@ -12,13 +12,16 @@
|
||||
#include "Controls/CalculationResult.h"
|
||||
#include "Controls/OverflowTextBlock.h"
|
||||
#include "Controls/EquationTextBox.h"
|
||||
#include "Controls/MathRichEditBox.h"
|
||||
#include "CalcViewModel/HistoryViewModel.h"
|
||||
#include "TemplateSelectors/KeyGraphFeaturesTemplateSelector.h"
|
||||
#include "Views/CalculatorProgrammerDisplayPanel.xaml.h"
|
||||
#include "Views/CalculatorProgrammerOperators.xaml.h"
|
||||
#include "Views/CalculatorScientificAngleButtons.xaml.h"
|
||||
#include "Views/HistoryList.xaml.h"
|
||||
#include "Views/Memory.xaml.h"
|
||||
#include "Views/OperatorsPanel.xaml.h"
|
||||
#include "Views/GraphingCalculator/KeyGraphFeaturesPanel.xaml.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
|
@@ -10,24 +10,24 @@
|
||||
d:DesignWidth="400"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ListView x:Name="EquationInputList"
|
||||
<ListView x:Name="EquationInputList"
|
||||
VerticalContentAlignment="Top"
|
||||
IsItemClickEnabled="False"
|
||||
ItemsSource="{x:Bind Equations}"
|
||||
SelectionMode="None">
|
||||
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0,0,0,2"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0,0,0,2"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:EquationViewModel">
|
||||
<controls:EquationTextBox x:Uid="EquationInputButton"
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:EquationViewModel">
|
||||
<controls:EquationTextBox x:Uid="EquationInputButton"
|
||||
Margin="0,0,3,0"
|
||||
Style="{StaticResource EquationTextBoxStyle}"
|
||||
EquationColor="{x:Bind LineColor, Mode=OneWay}"
|
||||
@@ -35,27 +35,22 @@
|
||||
GotFocus="InputTextBox_GotFocus"
|
||||
Loaded="EquationTextBoxLoaded"
|
||||
LostFocus="InputTextBox_LostFocus"
|
||||
RemoveButtonClicked="EquationTextBox_RemoveButtonClicked">
|
||||
<controls:EquationTextBox.KeyGraphFeaturesContent>
|
||||
<StackPanel x:Name="KeyGraphFeaturesGrid" Visibility="{x:Bind KeyGraphFeaturesVisibility, Mode=OneWay}">
|
||||
<TextBlock Text="Key Graph Features"/>
|
||||
<TextBlock Text="{x:Bind Expression, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
</controls:EquationTextBox.KeyGraphFeaturesContent>
|
||||
<controls:EquationTextBox.ColorChooserFlyout>
|
||||
<Flyout x:Name="ColorChooserFlyout"
|
||||
RemoveButtonClicked="EquationTextBox_RemoveButtonClicked"
|
||||
KeyGraphFeaturesButtonClicked="EquationTextBox_KeyGraphFeaturesButtonClicked">
|
||||
<controls:EquationTextBox.ColorChooserFlyout>
|
||||
<Flyout x:Name="ColorChooserFlyout"
|
||||
x:Uid="ColorChooserFlyout"
|
||||
Placement="Bottom">
|
||||
<local:EquationStylePanelControl SelectedColor="{x:Bind LineColor, Mode=TwoWay}"/>
|
||||
</Flyout>
|
||||
</controls:EquationTextBox.ColorChooserFlyout>
|
||||
</controls:EquationTextBox>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
<ListView.Footer>
|
||||
<Button Margin="4"
|
||||
<local:EquationStylePanelControl SelectedColor="{x:Bind LineColor, Mode=TwoWay}"/>
|
||||
</Flyout>
|
||||
</controls:EquationTextBox.ColorChooserFlyout>
|
||||
</controls:EquationTextBox>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
<ListView.Footer>
|
||||
<Button Margin="4"
|
||||
Click="AddEquationButton_Click"
|
||||
Content="+"/>
|
||||
</ListView.Footer>
|
||||
</ListView>
|
||||
</ListView.Footer>
|
||||
</ListView>
|
||||
</UserControl>
|
||||
|
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "EquationInputArea.xaml.h"
|
||||
|
||||
@@ -33,7 +36,7 @@ EquationInputArea::EquationInputArea()
|
||||
ref new TypedEventHandler<AccessibilitySettings ^, Object ^>(this, &EquationInputArea::OnHighContrastChanged);
|
||||
|
||||
ReloadAvailableColors(m_accessibilitySettings->HighContrast);
|
||||
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -98,6 +101,18 @@ void EquationInputArea::EquationTextBox_RemoveButtonClicked(Object ^ sender, Rou
|
||||
}
|
||||
}
|
||||
|
||||
void EquationInputArea::EquationTextBox_KeyGraphFeaturesButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
auto tb = static_cast<EquationTextBox ^>(sender);
|
||||
auto eq = static_cast<EquationViewModel ^>(tb->DataContext);
|
||||
EquationVM = eq;
|
||||
KeyGraphFeaturesVisibilityChanged(this, ref new RoutedEventArgs());
|
||||
}
|
||||
|
||||
void EquationInputArea::EquationTextBox_EquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
}
|
||||
|
||||
void EquationInputArea::EquationTextBoxLoaded(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
auto tb = static_cast<EquationTextBox ^>(sender);
|
||||
|
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Views/GraphingCalculator/EquationInputArea.g.h"
|
||||
@@ -6,6 +9,7 @@
|
||||
#include "EquationStylePanelControl.xaml.h"
|
||||
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
|
||||
#include "Controls/EquationTextBox.h"
|
||||
#include "Converters/BooleanNegationConverter.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -16,8 +20,10 @@ namespace CalculatorApp
|
||||
|
||||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IObservableVector< ViewModel::EquationViewModel^ >^, Equations);
|
||||
OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY(ViewModel::EquationViewModel ^, EquationVM);
|
||||
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Media::SolidColorBrush ^> ^, AvailableColors);
|
||||
|
||||
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ KeyGraphFeaturesVisibilityChanged;
|
||||
|
||||
private:
|
||||
void OnPropertyChanged(Platform::String^ propertyName);
|
||||
@@ -37,6 +43,8 @@ namespace CalculatorApp
|
||||
Windows::UI::ViewManagement::AccessibilitySettings ^ m_accessibilitySettings;
|
||||
int m_lastLineColorIndex;
|
||||
void EquationTextBox_RemoveButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void EquationTextBox_KeyGraphFeaturesButtonClicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void EquationTextBox_EquationButtonClicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void EquationTextBoxLoaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
};
|
||||
}
|
||||
|
@@ -9,8 +9,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:CalculatorApp.ViewModel"
|
||||
DataContextChanged="GraphingCalculator_DataContextChanged"
|
||||
mc:Ignorable="d"
|
||||
>
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="ZoomRepeatButtonStyle" TargetType="RepeatButton">
|
||||
@@ -33,7 +32,7 @@
|
||||
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid x:Name="RootGrid" >
|
||||
<Grid x:Name="RootGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="RowHamburger" Height="{StaticResource HamburgerHeightGridLength}"/>
|
||||
<RowDefinition/>
|
||||
@@ -48,39 +47,75 @@
|
||||
Grid.Row="1"
|
||||
Grid.Column="0">
|
||||
<Grid Grid.Row="0" Margin="4,7,4,4">
|
||||
<graphControl:Grapher Name="GraphingControl"
|
||||
EquationsSource="{x:Bind ViewModel.Equations, Mode=OneWay}"
|
||||
ForceProportionalAxes="True"
|
||||
UseSystemFocusVisuals="True"
|
||||
VariablesUpdated="GraphVariablesUpdated"
|
||||
LostFocus="OnGraphLostFocus"
|
||||
LosingFocus="OnLoosingFocus">
|
||||
<graphControl:Grapher Name="GraphingControl"
|
||||
EquationsSource="{x:Bind ViewModel.Equations, Mode=OneWay}"
|
||||
ForceProportionalAxes="True"
|
||||
LosingFocus="OnLoosingFocus"
|
||||
LostFocus="OnGraphLostFocus"
|
||||
UseSystemFocusVisuals="True"
|
||||
VariablesUpdated="GraphVariablesUpdated">
|
||||
<graphControl:Grapher.Background>
|
||||
<SolidColorBrush Color="White"/>
|
||||
</graphControl:Grapher.Background>
|
||||
<graphControl:Grapher.EquationTemplate>
|
||||
<DataTemplate x:DataType="vm:EquationViewModel">
|
||||
<graphControl:Equation Expression="{x:Bind Expression, Mode=OneWay}" LineColor="{x:Bind LineColor, Mode=OneWay}"/>
|
||||
<graphControl:Equation AnalysisError="{x:Bind AnalysisError, Mode=TwoWay}"
|
||||
Domain="{x:Bind Domain, Mode=TwoWay}"
|
||||
Expression="{x:Bind Expression, Mode=OneWay}"
|
||||
HorizontalAsymptotes="{x:Bind HorizontalAsymptotes, Mode=TwoWay}"
|
||||
InflectionPoints="{x:Bind InflectionPoints, Mode=TwoWay}"
|
||||
IsAnalysisUpdated="{x:Bind IsAnalysisUpdated, Mode=TwoWay}"
|
||||
LineColor="{x:Bind LineColor, Mode=OneWay}"
|
||||
Maxima="{x:Bind Maxima, Mode=TwoWay}"
|
||||
Minima="{x:Bind Minima, Mode=TwoWay}"
|
||||
Monotonicity="{x:Bind Monotonicity, Mode=TwoWay}"
|
||||
ObliqueAsymptotes="{x:Bind ObliqueAsymptotes, Mode=TwoWay}"
|
||||
Parity="{x:Bind Parity, Mode=TwoWay}"
|
||||
PeriodicityDirection="{x:Bind PeriodicityDirection, Mode=TwoWay}"
|
||||
PeriodicityExpression="{x:Bind PeriodicityExpression, Mode=TwoWay}"
|
||||
Range="{x:Bind Range, Mode=TwoWay}"
|
||||
TooComplexFeatures="{x:Bind TooComplexFeatures, Mode=TwoWay}"
|
||||
VerticalAsymptotes="{x:Bind VerticalAsymptotes, Mode=TwoWay}"
|
||||
XIntercept="{x:Bind XIntercept, Mode=TwoWay}"
|
||||
YIntercept="{x:Bind YIntercept, Mode=TwoWay}"/>
|
||||
</DataTemplate>
|
||||
</graphControl:Grapher.EquationTemplate>
|
||||
|
||||
</graphControl:Grapher>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,10,10">
|
||||
<Button x:Name="ActiveTracing" Click="OnActiveTracingClick" MinWidth="40" MinHeight="40" Margin="0,0,10,0">
|
||||
<StackPanel Grid.Row="0"
|
||||
Margin="0,0,10,10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal">
|
||||
<Button x:Name="ActiveTracing"
|
||||
MinWidth="40"
|
||||
MinHeight="40"
|
||||
Margin="0,0,10,0"
|
||||
Click="OnActiveTracingClick">
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||
</Button>
|
||||
<Button x:Name="Share" Click="OnShareClick" MinWidth="40" MinHeight="40">
|
||||
<Button x:Name="Share"
|
||||
MinWidth="40"
|
||||
MinHeight="40"
|
||||
Click="OnShareClick">
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<Popup x:Name="TraceValuePopup" Grid.Row="0" RenderTransformOrigin="0,1">
|
||||
|
||||
<Popup x:Name="TraceValuePopup"
|
||||
Grid.Row="0"
|
||||
RenderTransformOrigin="0,1">
|
||||
<Popup.RenderTransform>
|
||||
<TranslateTransform x:Name="TraceValuePopupTransform" X="50" Y="150"/>
|
||||
</Popup.RenderTransform>
|
||||
<Grid Background="{StaticResource ToolTipBackground}" BorderBrush="{StaticResource ToolTipBorderBrush}" BorderThickness="3,3,3,3">
|
||||
<TextBlock x:Name="TraceValue" Text="x=0,y=0" Margin="5,5,5,5" Foreground="{StaticResource ToolTipForeground}"/>
|
||||
<Grid Background="{StaticResource ToolTipBackground}"
|
||||
BorderBrush="{StaticResource ToolTipBorderBrush}"
|
||||
BorderThickness="3,3,3,3">
|
||||
<TextBlock x:Name="TraceValue"
|
||||
Margin="5,5,5,5"
|
||||
Foreground="{StaticResource ToolTipForeground}"
|
||||
Text="x=0,y=0"/>
|
||||
</Grid>
|
||||
</Popup>
|
||||
|
||||
@@ -392,20 +427,30 @@
|
||||
<RowDefinition Height="3*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid>
|
||||
<!-- Ideally the KeyGraphFeaturesPanel should be a frame so that navigation to and from the panel could be handled nicely -->
|
||||
<local:KeyGraphFeaturesPanel x:Name="KeyGraphFeaturesControl"
|
||||
Grid.RowSpan="2"
|
||||
x:Load="{x:Bind IsKeyGraphFeaturesVisible, Mode=OneWay}"
|
||||
KeyGraphFeaturesClosed="OnKeyGraphFeaturesClosed"
|
||||
ViewModel="{x:Bind EquationInputAreaControl.EquationVM, Mode=OneWay}"
|
||||
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Mode=OneWay}"/>
|
||||
<Grid x:Name="EquationInputAreaGrid" Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<local:EquationInputArea Grid.Row="1"
|
||||
<local:EquationInputArea x:Name="EquationInputAreaControl"
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Equations="{x:Bind ViewModel.Equations}"/>
|
||||
Equations="{x:Bind ViewModel.Equations}"
|
||||
KeyGraphFeaturesVisibilityChanged="OnEquationKeyGraphFeaturesVisibilityChanged"/>
|
||||
</Grid>
|
||||
|
||||
<Grid x:Name="ButtonContainerGrid"
|
||||
Grid.Row="1"
|
||||
Margin="3,0,3,3"
|
||||
UseLayoutRounding="False">
|
||||
UseLayoutRounding="False"
|
||||
Visibility="{x:Bind IsKeyGraphFeaturesVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
|
@@ -1,9 +1,13 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
#include "GraphingCalculator.xaml.h"
|
||||
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
|
||||
#include "Controls/CalculationResult.h"
|
||||
#include "Calculator\Controls\EquationTextBox.h"
|
||||
#include "Calculator\Views\GraphingCalculator\EquationInputArea.xaml.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::Common;
|
||||
@@ -311,3 +315,13 @@ void CalculatorApp::GraphingCalculator::OnLoosingFocus(Windows::UI::Xaml::UIElem
|
||||
args->TryCancel();
|
||||
}
|
||||
}
|
||||
|
||||
void GraphingCalculator::OnEquationKeyGraphFeaturesVisibilityChanged(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
IsKeyGraphFeaturesVisible = true;
|
||||
}
|
||||
|
||||
void GraphingCalculator::OnKeyGraphFeaturesClosed(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
IsKeyGraphFeaturesVisible = false;
|
||||
}
|
||||
|
@@ -1,8 +1,12 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Views\GraphingCalculator\GraphingCalculator.g.h"
|
||||
#include "CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h"
|
||||
#include "Views\NumberPad.xaml.h"
|
||||
#include "Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -18,6 +22,7 @@ namespace CalculatorApp
|
||||
COMMAND_FOR_METHOD(ZoomOutButtonPressed, GraphingCalculator::OnZoomOutCommand);
|
||||
COMMAND_FOR_METHOD(ZoomInButtonPressed, GraphingCalculator::OnZoomInCommand);
|
||||
COMMAND_FOR_METHOD(ZoomResetButtonPressed, GraphingCalculator::OnZoomResetCommand);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsKeyGraphFeaturesVisible);
|
||||
|
||||
property CalculatorApp::ViewModel::GraphingCalculatorViewModel^ ViewModel
|
||||
{
|
||||
@@ -57,7 +62,8 @@ namespace CalculatorApp
|
||||
void OnActiveTracingClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void OnGraphLostFocus(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void OnLoosingFocus(Windows::UI::Xaml::UIElement ^ sender, Windows::UI::Xaml::Input::LosingFocusEventArgs ^ args);
|
||||
|
||||
void OnEquationKeyGraphFeaturesVisibilityChanged(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void OnKeyGraphFeaturesClosed(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
bool ActiveTracingOn;
|
||||
};
|
||||
|
||||
|
@@ -0,0 +1,462 @@
|
||||
<UserControl x:Class="CalculatorApp.KeyGraphFeaturesPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:CalculatorApp.Controls"
|
||||
xmlns:converters="using:CalculatorApp.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:CalculatorApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ts="using:CalculatorApp.TemplateSelectors"
|
||||
xmlns:vm="using:CalculatorApp.ViewModel"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="KGF_EquationTextBoxStyle" TargetType="controls:EquationTextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||
<Setter Property="FontWeight" Value="Normal"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}"/>
|
||||
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="Typography.StylisticSet20" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:EquationTextBox">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<Style x:Key="KGF_EquationTextBoxStyle" TargetType="controls:MathRichEditBox">
|
||||
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="ContentLinkForegroundColor" Value="{ThemeResource ContentLinkForegroundColor}"/>
|
||||
<Setter Property="ContentLinkBackgroundColor" Value="{ThemeResource ContentLinkBackgroundColor}"/>
|
||||
<Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
|
||||
<Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="{ThemeResource IsApplicationFocusVisualKindReveal}"/>
|
||||
<Setter Property="ContextFlyout" Value="{StaticResource TextControlCommandBarContextFlyout}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:MathRichEditBox">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled"/>
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="PointerOver"/>
|
||||
<VisualState x:Name="Focused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ContentPresenter x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{ThemeResource RichEditBoxTopHeaderMargin}"
|
||||
Foreground="{ThemeResource TextControlHeaderForeground}"
|
||||
FontWeight="Normal"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed"/>
|
||||
<Border x:Name="BorderElement"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
MinWidth="{ThemeResource TextControlThemeMinWidth}"
|
||||
MinHeight="{ThemeResource TextControlThemeMinHeight}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0"
|
||||
Control.IsTemplateFocusTarget="True"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
<ScrollViewer x:Name="ContentElement"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsTabStop="False"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="Disabled"/>
|
||||
<TextBlock x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"/>
|
||||
<ContentPresenter x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Background="Transparent"
|
||||
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
|
||||
x:Load="False"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Content="{TemplateBinding Description}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="44"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button x:Name="EquationButton"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding EquationColor}"
|
||||
Foreground="{StaticResource SystemChromeWhiteColor}"
|
||||
BorderThickness="0">
|
||||
<Button.Content>
|
||||
<StackPanel Margin="5,0"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal">
|
||||
<FontIcon VerticalAlignment="Center"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Glyph=""/>
|
||||
<TextBlock Margin="12,-4,0,0"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="16"
|
||||
Text="ƒₓ"/>
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
<Button.Resources>
|
||||
<SolidColorBrush x:Name="ButtonBackgroundPointerOver"
|
||||
Opacity="0.7"
|
||||
Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
<SolidColorBrush x:Name="ButtonForegroundPointerOver" Color="{ThemeResource SystemChromeWhiteColor}"/>
|
||||
<SolidColorBrush x:Name="ButtonBorderBrushPointerOver" Color="Transparent"/>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
|
||||
<controls:MathRichEditBox x:Name="EquationTextBox"
|
||||
Grid.Column="1"
|
||||
MinHeight="44"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Stretch"
|
||||
Style="{StaticResource MathRichEdit_EquationTextBoxStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
AcceptsReturn="false"
|
||||
InputScope="Text"
|
||||
IsReadOnly="True"
|
||||
MaxLength="2048"
|
||||
TextWrapping="NoWrap"
|
||||
UseSystemFocusVisuals="True"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="KGF_RichEditBoxStyle" TargetType="controls:MathRichEditBox">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="IsEnabled" Value="True"/>
|
||||
<Setter Property="Margin" Value="-8,0,0,0"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True"/>
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Typography.StylisticSet20" Value="True"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Typography.StylisticSet20" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RichEditBox">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled">
|
||||
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForeground}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundDisabled}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="PointerOver"/>
|
||||
<VisualState x:Name="Focused"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<ContentPresenter x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Margin="{ThemeResource RichEditBoxTopHeaderMargin}"
|
||||
Foreground="{ThemeResource TextControlHeaderForeground}"
|
||||
FontWeight="Normal"
|
||||
x:DeferLoadStrategy="Lazy"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="Collapsed"/>
|
||||
<Border x:Name="BorderElement"
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
MinWidth="{ThemeResource TextControlThemeMinWidth}"
|
||||
MinHeight="{ThemeResource TextControlThemeMinHeight}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
<ScrollViewer x:Name="ContentElement"
|
||||
Grid.Row="1"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||
IsTabStop="False"
|
||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||
ZoomMode="Disabled"/>
|
||||
<TextBlock x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Foreground="{ThemeResource TextControlPlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"/>
|
||||
<ContentPresenter x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
|
||||
x:Load="False"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Content="{TemplateBinding Description}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Name="KGF_TitleTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="Medium"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="TextWrapping" Value="WrapWholeWords"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="AutomationProperties.HeadingLevel" Value="Level2"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Name="KGF_TextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="Normal"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="TextWrapping" Value="WrapWholeWords"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Name="KGF_ListViewItemContainerStyle" TargetType="ListViewItem">
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
|
||||
<Setter Property="Margin" Value="0,10"/>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="KGFRichEditDataTemplate" x:DataType="vm:KeyGraphFeaturesItem">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="TitleTextBlock"
|
||||
Style="{StaticResource KGF_TitleTextBlockStyle}"
|
||||
Text="{x:Bind Title, Mode=OneWay}"/>
|
||||
<ItemsControl ItemsSource="{x:Bind DisplayItems, Mode=OneWay}" UseSystemFocusVisuals="True">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<controls:MathRichEditBox HorizontalAlignment="Left"
|
||||
HorizontalContentAlignment="Left"
|
||||
Style="{StaticResource KGF_RichEditBoxStyle}"
|
||||
MathText="{x:Bind}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="KGFGridDataTemplate" x:DataType="vm:KeyGraphFeaturesItem">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="TitleTextBlock"
|
||||
Style="{StaticResource KGF_TitleTextBlockStyle}"
|
||||
Text="{x:Bind Title, Mode=OneWay}"/>
|
||||
<ItemsControl ItemsSource="{x:Bind GridItems, Mode=OneWay}" UseSystemFocusVisuals="True">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:GridDisplayItems">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<controls:MathRichEditBox Grid.Column="0"
|
||||
MinWidth="25"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource KGF_RichEditBoxStyle}"
|
||||
MathText="{x:Bind Expression}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource KGF_TextBlockStyle}"
|
||||
Text="{x:Bind Direction}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="KGFTextBlockDataTemplate" x:DataType="vm:KeyGraphFeaturesItem">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="TitleTextBlock"
|
||||
Style="{StaticResource KGF_TitleTextBlockStyle}"
|
||||
Text="{x:Bind Title, Mode=OneWay}"/>
|
||||
<ItemsControl ItemsSource="{x:Bind DisplayItems, Mode=OneWay}" UseSystemFocusVisuals="True">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<TextBlock Style="{StaticResource KGF_TextBlockStyle}" Text="{x:Bind}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<ts:KeyGraphFeaturesTemplateSelector x:Key="KGFTemplateSelector"
|
||||
GridTemplate="{StaticResource KGFGridDataTemplate}"
|
||||
RichEditTemplate="{StaticResource KGFRichEditDataTemplate}"
|
||||
TextBlockTemplate="{StaticResource KGFTextBlockDataTemplate}"/>
|
||||
|
||||
<converters:BooleanToVisibilityNegationConverter x:Name="BooleanToVisibilityNegationConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="0,7,0,0" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<controls:EquationTextBox x:Name="EquationInputTextBox"
|
||||
x:Uid="EquationInputButton"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,3,0"
|
||||
Style="{StaticResource KGF_EquationTextBoxStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
DataContext="{x:Bind ViewModel, Mode=OneWay}"
|
||||
EquationButtonClicked="EquationButtonClicked"
|
||||
Loaded="EquationInputTextBox_Loaded"/>
|
||||
<TextBlock x:Uid="KeyGraphFeaturesLabel"
|
||||
Grid.Row="1"
|
||||
Margin="12,20,10,0"
|
||||
Style="{StaticResource KGF_TitleTextBlockStyle}"
|
||||
FontSize="18"
|
||||
AutomationProperties.HeadingLevel="Level1"/>
|
||||
|
||||
<ListView x:Name="KeyGraphFeaturesListView"
|
||||
Grid.Row="2"
|
||||
Margin="12,10,10,0"
|
||||
Padding="0,0,0,12"
|
||||
IsItemClickEnabled="False"
|
||||
ItemContainerStyle="{StaticResource KGF_ListViewItemContainerStyle}"
|
||||
ItemTemplateSelector="{StaticResource KGFTemplateSelector}"
|
||||
ItemsSource="{x:Bind ViewModel.KeyGraphFeaturesItems}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.VerticalScrollMode="Auto"
|
||||
SelectionMode="None"
|
||||
Visibility="{x:Bind ViewModel.AnalysisErrorVisible, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
||||
<TextBlock x:Name="AnalysisErrorTextBlock"
|
||||
Grid.Row="2"
|
||||
Margin="12,10,10,0"
|
||||
Style="{StaticResource KGF_TextBlockStyle}"
|
||||
FontWeight="Normal"
|
||||
Text="{x:Bind ViewModel.AnalysisErrorString, Mode=OneWay}"
|
||||
Visibility="{x:Bind ViewModel.AnalysisErrorVisible, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -0,0 +1,53 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "KeyGraphFeaturesPanel.xaml.h"
|
||||
#include "Controls/MathRichEditBox.h"
|
||||
#include "CalcViewModel/GraphingCalculatorEnums.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace Platform;
|
||||
using namespace Windows::UI;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
|
||||
KeyGraphFeaturesPanel::KeyGraphFeaturesPanel()
|
||||
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void KeyGraphFeaturesPanel::OnPropertyChanged(String ^ propertyName)
|
||||
{
|
||||
if (propertyName == L"ViewModel")
|
||||
{
|
||||
if (ViewModel == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetEquationTextBoxProperties();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyGraphFeaturesPanel::EquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
KeyGraphFeaturesClosed(this, ref new RoutedEventArgs());
|
||||
}
|
||||
|
||||
void KeyGraphFeaturesPanel::EquationInputTextBox_Loaded(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
if (ViewModel != nullptr)
|
||||
{
|
||||
SetEquationTextBoxProperties();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyGraphFeaturesPanel::SetEquationTextBoxProperties()
|
||||
{
|
||||
EquationInputTextBox->SetEquationText(ViewModel->Expression);
|
||||
EquationInputTextBox->EquationColor = ViewModel->LineColor;
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Views\GraphingCalculator\KeyGraphFeaturesPanel.g.h"
|
||||
#include "CalcViewModel\GraphingCalculator\EquationViewModel.h"
|
||||
#include "Controls/MathRichEditBox.h"
|
||||
#include "Controls/EquationTextBox.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
public
|
||||
ref class KeyGraphFeaturesPanel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
public:
|
||||
KeyGraphFeaturesPanel();
|
||||
|
||||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY(CalculatorApp::ViewModel::EquationViewModel ^, ViewModel);
|
||||
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ KeyGraphFeaturesClosed;
|
||||
|
||||
private:
|
||||
|
||||
void OnPropertyChanged(Platform::String ^ propertyName);
|
||||
void EquationButtonClicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void SetEquationTextBoxProperties();
|
||||
void EquationInputTextBox_Loaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user