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:
Stephanie Anderl
2019-11-12 13:46:11 -08:00
committed by GitHub
parent 626bdf0de5
commit 442ed6a861
48 changed files with 2931 additions and 476 deletions

View File

@@ -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="&#xE26C;"/>
FontSize="{TemplateBinding ScrollButtonFontSize}"
Glyph="&#xE26C;"/>
</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="&#xE26B;"/>
FontSize="{TemplateBinding ScrollButtonFontSize}"
Glyph="&#xE26B;"/>
</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="&#xe81c;"
ExitDisplayModeOnAccessKeyInvoked="False"
TabIndex="2">
x:Uid="HistoryButton"
Grid.Row="0"
Style="{StaticResource HistoryButtonStyle}"
AutomationProperties.AutomationId="HistoryButton"
Command="{x:Bind HistoryButtonPressed, Mode=OneTime}"
Content="&#xe81c;"
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"/>