diff --git a/src/Calculator/App.xaml b/src/Calculator/App.xaml
index 4930120e..9e91566d 100644
--- a/src/Calculator/App.xaml
+++ b/src/Calculator/App.xaml
@@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="using:CalculatorApp.Controls"
xmlns:common="using:CalculatorApp.Common"
- xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:local="using:CalculatorApp">
@@ -15,8 +14,6 @@
0,0,0,0
0
- 0.3
- 0.5
#FF000000
#FF2B2B2B
#FF858585
@@ -69,22 +66,9 @@
FallbackColor="{ThemeResource SystemChromeMediumColor}"
TintColor="{ThemeResource SystemChromeLowColor}"
TintOpacity="0.7"/>
-
-
-
+ Dark
-
-
-
-
-
-
-
@@ -108,8 +92,6 @@
0
#FFF2F2F2
#FFE0E0E0
- 0.2
- 0.4
#FF858585
@@ -165,19 +147,8 @@
FallbackColor="{ThemeResource SystemChromeMediumColor}"
TintColor="{ThemeResource SystemChromeLowColor}"
TintOpacity="0.8"/>
-
-
-
-
-
-
-
-
-
+ Light
-
@@ -198,8 +169,6 @@
0,1,0,0
2
- 1.0
- 1.0
@@ -224,21 +193,12 @@
-
-
-
-
-
-
-
-
-
-
+ Dark
-
+
@@ -1628,75 +1588,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Calculator/Resources/en-US/Resources.resw b/src/Calculator/Resources/en-US/Resources.resw
index e19f73a9..8182ac5d 100644
--- a/src/Calculator/Resources/en-US/Resources.resw
+++ b/src/Calculator/Resources/en-US/Resources.resw
@@ -1109,9 +1109,9 @@
Delete
Text string for the Calculator Delete swipe button in the History list
-
- Copy
- Text string for the Calculator Copy option in the History list context menu
+
+ Copy
+ Text string for the Calculator Copy option in the History list context menu
Delete
@@ -3517,7 +3517,7 @@
Calculation failed
- Text displayed when the application is not able to do a calculation
+ Text displayed when the application is not able to do a calculation
Log base X
@@ -4110,7 +4110,7 @@
Back
This is the tooltip for the back button in the equation analysis page in the graphing calculator
-
+
Back
This is the automation name for the back button in the equation analysis page in the graphing calculator
@@ -4206,4 +4206,8 @@
Enter an equation
Used in the Graphing Calculator to indicate to users that they can enter an equation in the textbox
-
+
+ Enter an equation
+ this is the placeholder text used by the textbox to enter an equation
+
+
\ No newline at end of file
diff --git a/src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml b/src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml
index 3b8c0dfe..b064e149 100644
--- a/src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml
+++ b/src/Calculator/Views/GraphingCalculator/EquationInputArea.xaml
@@ -1,6 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml
index fe5c112e..37eb4a76 100644
--- a/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml
+++ b/src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml
@@ -11,10 +11,8 @@
x:Name="Control"
DataContextChanged="GraphingCalculator_DataContextChanged"
mc:Ignorable="d">
-
-
4,4,0,0
0,0,4,4
4,0,0,4
0,4,4,0
+
0
0
0
0
+
-
-
-
-
-
+ VariablesUpdated="GraphingControl_VariablesUpdated"/>
+ Style="{ThemeResource GraphControlCommandPanel}">
+ Style="{ThemeResource GraphControlCommandPanel}">
Loaded += ref new RoutedEventHandler(this, &Grapher::OnLoaded);
- this->Unloaded += ref new RoutedEventHandler(this, &Grapher::OnUnloaded);
-
this->ManipulationMode = ManipulationModes::TranslateX | ManipulationModes::TranslateY | ManipulationModes::TranslateInertia | ManipulationModes::Scale
| ManipulationModes::ScaleInertia;
@@ -79,25 +78,6 @@ namespace GraphControl
auto& formatOptions = m_solver->FormatOptions();
}
- void Grapher::OnLoaded(Object ^ sender, RoutedEventArgs ^ args)
- {
- if (auto backgroundBrush = safe_cast(this->Background))
- {
- m_tokenBackgroundColorChanged.Value = backgroundBrush->RegisterPropertyChangedCallback(
- SolidColorBrush::ColorProperty, ref new DependencyPropertyChangedCallback(this, &Grapher::OnDependencyPropertyChanged));
-
- OnBackgroundColorChanged(backgroundBrush->Color);
- }
- }
-
- void Grapher::OnUnloaded(Object ^ sender, RoutedEventArgs ^ args)
- {
- if (auto backgroundBrush = safe_cast(this->Background))
- {
- this->UnregisterPropertyChangedCallback(BackgroundProperty, m_tokenBackgroundColorChanged.Value);
- }
- }
-
void Grapher::ZoomFromCenter(double scale)
{
ScaleRange(0, 0, scale);
@@ -138,20 +118,12 @@ namespace GraphControl
{
swapChainPanel->AllowFocusOnInteraction = true;
m_renderMain = ref new RenderMain(swapChainPanel);
+ m_renderMain->BackgroundColor = GraphBackground;
}
TryUpdateGraph();
}
- void Grapher::OnDependencyPropertyChanged(DependencyObject ^ obj, DependencyProperty ^ p)
- {
- if (p == SolidColorBrush::ColorProperty)
- {
- auto brush = static_cast(obj);
- OnBackgroundColorChanged(brush->Color);
- }
- }
-
void Grapher::OnEquationsPropertyChanged(EquationCollection ^ oldValue, EquationCollection ^ newValue)
{
if (oldValue != nullptr)
@@ -512,14 +484,6 @@ namespace GraphControl
TryUpdateGraph();
}
- void Grapher::OnBackgroundColorChanged(const Windows::UI::Color& color)
- {
- if (m_renderMain)
- {
- m_renderMain->BackgroundColor = color;
- }
- }
-
void Grapher::OnPointerEntered(PointerRoutedEventArgs ^ e)
{
if (m_renderMain)
@@ -894,3 +858,27 @@ String ^ Grapher::ConvertToLinear(String ^ mmlString)
return ref new String(linearExpression.c_str());
}
+
+void Grapher::OnAxesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
+{
+ if (m_graph)
+ {
+ auto axesColor = Graphing::Color(newValue.R, newValue.G, newValue.B, newValue.A);
+ m_graph->GetOptions().SetAxisColor(axesColor);
+ m_graph->GetOptions().SetFontColor(axesColor);
+ }
+}
+
+void Grapher::OnGraphBackgroundPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
+{
+ if (m_renderMain)
+ {
+ m_renderMain->BackgroundColor = newValue;
+ }
+ if (m_graph)
+ {
+ auto color = Graphing::Color(newValue.R, newValue.G, newValue.B, newValue.A);
+ m_graph->GetOptions().SetBackColor(color);
+ m_graph->GetOptions().SetBoxColor(color);
+ }
+}
diff --git a/src/GraphControl/Control/Grapher.h b/src/GraphControl/Control/Grapher.h
index f09f3e79..fa84aec7 100644
--- a/src/GraphControl/Control/Grapher.h
+++ b/src/GraphControl/Control/Grapher.h
@@ -21,7 +21,9 @@ public
public
delegate void TracingValueChangedEventHandler(Windows::Foundation::Point value);
- [Windows::UI::Xaml::Markup::ContentPropertyAttribute(Name = L"Equations")] public ref class Grapher sealed : public Windows::UI::Xaml::Controls::Control, public Windows::UI::Xaml::Data::INotifyPropertyChanged
+ [Windows::UI::Xaml::Markup::ContentPropertyAttribute(Name = L"Equations")] public ref class Grapher sealed
+ : public Windows::UI::Xaml::Controls::Control,
+ public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
event TracingValueChangedEventHandler ^ TracingValueChangedEvent;
@@ -38,8 +40,10 @@ public
Variables,
SINGLE_ARG(ref new Platform::Collections::Map()));
DEPENDENCY_PROPERTY_R_WITH_DEFAULT_AND_CALLBACK(GraphControl::EquationCollection ^, Equations, nullptr);
- // Pass active tracing turned on or off down to the renderer
+ DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(Windows::UI::Color, AxesColor, Windows::UI::Colors::Transparent);
+ DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(Windows::UI::Color, GraphBackground, Windows::UI::Colors::Transparent);
+ // Pass active tracing turned on or off down to the renderer
property bool ActiveTracing
{
bool get()
@@ -115,13 +119,10 @@ public
#pragma endregion
private:
- void OnLoaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ args);
- void OnUnloaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ args);
-
void OnForceProportionalAxesPropertyChanged(bool oldValue, bool newValue);
void OnEquationsPropertyChanged(EquationCollection ^ oldValue, EquationCollection ^ newValue);
- void OnDependencyPropertyChanged(Windows::UI::Xaml::DependencyObject ^ obj, Windows::UI::Xaml::DependencyProperty ^ p);
-
+ void OnAxesColorPropertyChanged(Windows::UI::Color oldValue, Windows::UI::Color newValue);
+ void OnGraphBackgroundPropertyChanged(Windows::UI::Color oldValue, Windows::UI::Color newValue);
void OnEquationChanged(Equation ^ equation);
void OnEquationStyleChanged(Equation ^ equation);
void OnEquationLineEnabledChanged(Equation ^ equation);
@@ -133,8 +134,6 @@ public
std::shared_ptr GetGraph(GraphControl::Equation ^ equation);
void UpdateVariables();
- void OnBackgroundColorChanged(const Windows::UI::Color& color);
-
void ScaleRange(double centerX, double centerY, double scale);
void OnCoreKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ e);