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:
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user