Feature/GraphingCalculator initial commit (#450)
Initial PR for the feature/GraphingCalculator feature branch, part of #338. The feature incorporates a proprietary Microsoft-owned graphing engine to drive graphing experiences in the Windows Calculator app. Due to the private nature of the graphing engine, the source available in the public repo will make use of a mock graphing engine. See README.md for more details. This PR simply serves as a base for future feature development. As such, the PR will be immediately merged. Feedback on the content of this PR, and on the feature in general, is encouraged. If there is feedback related to the content of this specific PR, please leave comments on the PR page. We will address the comments in future PRs to the feature branch.
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
<UserControl x:Class="CalculatorApp.EquationInputArea"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:CalculatorApp.ViewModel"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="400"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Margin="0,0,17,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock x:Uid="EquationInputAreaHeader"
|
||||
Grid.Column="0"
|
||||
Style="{ThemeResource SubheaderTextBlockStyle}"
|
||||
FontSize="20"/>
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Click="AddEquationButton_Click"
|
||||
Content="+"/>
|
||||
</Grid>
|
||||
|
||||
<ListView x:Name="EquationInputList"
|
||||
Grid.Row="2"
|
||||
Margin="0,4,0,0"
|
||||
IsItemClickEnabled="False"
|
||||
ItemsSource="{x:Bind Equations}"
|
||||
SelectionMode="None">
|
||||
|
||||
<ListView.Resources>
|
||||
<x:Double x:Key="ItemHeight">40</x:Double>
|
||||
</ListView.Resources>
|
||||
|
||||
<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,17,1"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:EquationViewModel">
|
||||
<Grid Height="{StaticResource ItemHeight}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.Resources>
|
||||
<SolidColorBrush x:Key="LineColorBrush" Color="{x:Bind LineColor, Mode=OneWay}"/>
|
||||
</Grid.Resources>
|
||||
<Grid.Background>
|
||||
<StaticResource ResourceKey="LineColorBrush"/>
|
||||
</Grid.Background>
|
||||
|
||||
<Button Width="{StaticResource ItemHeight}"
|
||||
Height="{StaticResource ItemHeight}"
|
||||
Background="{StaticResource LineColorBrush}"/>
|
||||
|
||||
<Rectangle x:Name="InputBackplate"
|
||||
Grid.Column="1"
|
||||
Margin="0,2,3,2"
|
||||
Fill="White"/>
|
||||
|
||||
<TextBox Grid.Column="1"
|
||||
Margin="0,2,3,2"
|
||||
GotFocus="InputTextBox_GotFocus"
|
||||
KeyUp="InputTextBox_KeyUp"
|
||||
LostFocus="InputTextBox_LostFocus"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -0,0 +1,108 @@
|
||||
#include "pch.h"
|
||||
#include "EquationInputArea.xaml.h"
|
||||
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::Common;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Windows::System;
|
||||
using namespace Windows::UI;
|
||||
using namespace Windows::UI::ViewManagement;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
|
||||
namespace
|
||||
{
|
||||
const Color accentColor = (ref new UISettings())->GetColorValue(UIColorType::Accent);
|
||||
const Color lineColors[] = {
|
||||
accentColor,
|
||||
Colors::DarkOrange,
|
||||
Colors::MediumPurple,
|
||||
Colors::ForestGreen,
|
||||
Colors::BlueViolet,
|
||||
Colors::DarkRed,
|
||||
Colors::LightGoldenrodYellow,
|
||||
Colors::DarkOliveGreen
|
||||
};
|
||||
const size_t lineColorsSize = std::size(lineColors);
|
||||
|
||||
StringReference EquationsPropertyName(L"Equations");
|
||||
}
|
||||
|
||||
EquationInputArea::EquationInputArea()
|
||||
: m_lastLineColorIndex{ -1 }
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void EquationInputArea::OnPropertyChanged(String^ propertyName)
|
||||
{
|
||||
if (propertyName == EquationsPropertyName)
|
||||
{
|
||||
OnEquationsPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void EquationInputArea::OnEquationsPropertyChanged()
|
||||
{
|
||||
if (Equations != nullptr && Equations->Size == 0)
|
||||
{
|
||||
AddNewEquation();
|
||||
|
||||
// For now, the first equation needs to be y = 0.
|
||||
// We can remove this when we can create empty graphs.
|
||||
if (EquationViewModel^ eqvm = Equations->GetAt(0))
|
||||
{
|
||||
eqvm->Expression = L"0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EquationInputArea::AddEquationButton_Click(Object^ sender, RoutedEventArgs^ e)
|
||||
{
|
||||
AddNewEquation();
|
||||
}
|
||||
|
||||
void EquationInputArea::AddNewEquation()
|
||||
{
|
||||
auto eq = ref new EquationViewModel();
|
||||
eq->LineColor = GetNextLineColor();
|
||||
|
||||
Equations->Append(eq);
|
||||
EquationInputList->ScrollIntoView(eq);
|
||||
}
|
||||
|
||||
void EquationInputArea::InputTextBox_GotFocus(Object^ sender, RoutedEventArgs^ e)
|
||||
{
|
||||
KeyboardShortcutManager::HonorShortcuts(false);
|
||||
}
|
||||
|
||||
void EquationInputArea::InputTextBox_LostFocus(Object^ sender, RoutedEventArgs^ e)
|
||||
{
|
||||
KeyboardShortcutManager::HonorShortcuts(true);
|
||||
|
||||
auto tb = static_cast<TextBox^>(sender);
|
||||
auto eq = static_cast<EquationViewModel^>(tb->DataContext);
|
||||
tb->Text = eq->Expression;
|
||||
}
|
||||
|
||||
void EquationInputArea::InputTextBox_KeyUp(Object^ sender, KeyRoutedEventArgs^ e)
|
||||
{
|
||||
if (e->Key == VirtualKey::Enter)
|
||||
{
|
||||
auto tb = static_cast<TextBox^>(sender);
|
||||
auto eq = static_cast<EquationViewModel^>(tb->DataContext);
|
||||
eq->Expression = tb->Text;
|
||||
|
||||
e->Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Color EquationInputArea::GetNextLineColor()
|
||||
{
|
||||
m_lastLineColorIndex = (m_lastLineColorIndex + 1) % lineColorsSize;
|
||||
return lineColors[m_lastLineColorIndex];
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "Views/GraphingCalculator/EquationInputArea.g.h"
|
||||
#include "CalcViewModel/Common/Utils.h"
|
||||
#include "CalcViewModel/GraphingCalculator/EquationViewModel.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
public ref class EquationInputArea sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
public:
|
||||
EquationInputArea();
|
||||
|
||||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IObservableVector< ViewModel::EquationViewModel^ >^, Equations);
|
||||
|
||||
private:
|
||||
void OnPropertyChanged(Platform::String^ propertyName);
|
||||
void OnEquationsPropertyChanged();
|
||||
|
||||
void AddEquationButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void AddNewEquation();
|
||||
|
||||
void InputTextBox_GotFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void InputTextBox_LostFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void InputTextBox_KeyUp(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
|
||||
|
||||
Windows::UI::Color GetNextLineColor();
|
||||
|
||||
private:
|
||||
int m_lastLineColorIndex;
|
||||
};
|
||||
}
|
242
src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml
Normal file
242
src/Calculator/Views/GraphingCalculator/GraphingCalculator.xaml
Normal file
@@ -0,0 +1,242 @@
|
||||
<UserControl x:Class="CalculatorApp.GraphingCalculator"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:CalculatorApp.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:graphControl="using:GraphControl"
|
||||
xmlns:local="using:CalculatorApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:CalculatorApp.ViewModel"
|
||||
DataContextChanged="GraphingCalculator_DataContextChanged"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="RootGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition x:Name="RowHamburger" Height="{StaticResource HamburgerHeightGridLength}"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Left portion of the screen -->
|
||||
<Grid x:Name="LeftGrid"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0">
|
||||
|
||||
<graphControl:Grapher Grid.Row="0"
|
||||
Margin="4,7,4,4"
|
||||
EquationsSource="{x:Bind ViewModel.Equations, Mode=OneWay}"
|
||||
ForceProportionalAxes="True"
|
||||
UseSystemFocusVisuals="True">
|
||||
<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}"/>
|
||||
</DataTemplate>
|
||||
</graphControl:Grapher.EquationTemplate>
|
||||
</graphControl:Grapher>
|
||||
</Grid>
|
||||
|
||||
<!-- Right portion of the screen -->
|
||||
<Grid x:Name="RightGrid"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="4,0,4,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="5*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<local:EquationInputArea Grid.Row="0" Equations="{x:Bind ViewModel.Equations}"/>
|
||||
|
||||
<Grid x:Name="ButtonContainerGrid"
|
||||
Grid.Row="1"
|
||||
Margin="3,0,3,3"
|
||||
UseLayoutRounding="False">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<controls:CalculatorButton x:Name="XButton"
|
||||
x:Uid="xButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
FontSize="16"
|
||||
ButtonId="X"
|
||||
Content="𝑥"
|
||||
FlowDirection="LeftToRight"/>
|
||||
<controls:CalculatorButton x:Name="YButton"
|
||||
x:Uid="yButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
FontSize="16"
|
||||
ButtonId="Y"
|
||||
Content="𝑦"
|
||||
FlowDirection="LeftToRight"/>
|
||||
<controls:CalculatorButton x:Name="PowerButton"
|
||||
x:Uid="graphingPowerButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
ButtonId="XPowerY"
|
||||
Content="^"/>
|
||||
<controls:CalculatorButton x:Name="squareRootButton"
|
||||
x:Uid="squareRootButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ButtonId="Sqrt"
|
||||
Content=""/>
|
||||
|
||||
<!-- Display controls -->
|
||||
<controls:CalculatorButton x:Name="ClearButton"
|
||||
x:Uid="clearButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
FontSize="16"
|
||||
ButtonId="Clear"
|
||||
Content="C"/>
|
||||
<controls:CalculatorButton x:Name="BackSpaceButton"
|
||||
x:Uid="backSpaceButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||
FontSize="16"
|
||||
ButtonId="Backspace"
|
||||
Content=""/>
|
||||
|
||||
<!-- Basic operators -->
|
||||
<controls:CalculatorButton x:Name="EqualButton"
|
||||
x:Uid="graphingEqualButton"
|
||||
Grid.Row="0"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
ButtonId="Equals"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="DivideButton"
|
||||
x:Uid="divideButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
ButtonId="Divide"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="MultiplyButton"
|
||||
x:Uid="multiplyButton"
|
||||
Grid.Row="2"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
ButtonId="Multiply"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="MinusButton"
|
||||
x:Uid="minusButton"
|
||||
Grid.Row="3"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
ButtonId="Subtract"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="PlusButton"
|
||||
x:Uid="plusButton"
|
||||
Grid.Row="4"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
ButtonId="Add"
|
||||
Content=""/>
|
||||
|
||||
|
||||
<controls:CalculatorButton x:Name="logBase10Button"
|
||||
x:Uid="logBase10Button"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
ButtonId="LogBase10"
|
||||
Content="log"/>
|
||||
<controls:CalculatorButton x:Name="logBaseEButton"
|
||||
x:Uid="logBaseEButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
ButtonId="LogBaseE"
|
||||
Content="ln"/>
|
||||
<controls:CalculatorButton x:Name="powerOf10Button"
|
||||
x:Uid="powerOf10Button"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||
AutomationProperties.AutomationId="powerOf10Button"
|
||||
ButtonId="TenPowerX"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="powerOfEButton"
|
||||
x:Uid="powerOfEButton"
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||
ButtonId="EPowerX"
|
||||
Content=""/>
|
||||
<controls:CalculatorButton x:Name="piButton"
|
||||
x:Uid="piButton"
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||
FontSize="14"
|
||||
ButtonId="Pi"
|
||||
Content=""/>
|
||||
|
||||
<controls:CalculatorButton x:Name="openParenthesisButton"
|
||||
x:Uid="openParenthesisButton"
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource ParenthesisCalcButtonStyle}"
|
||||
FontSize="19"
|
||||
ButtonId="OpenParenthesis"
|
||||
Content="("/>
|
||||
<controls:CalculatorButton x:Name="closeParenthesisButton"
|
||||
x:Uid="closeParenthesisButton"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OperatorButtonStyle}"
|
||||
FontSize="19"
|
||||
ButtonId="CloseParenthesis"
|
||||
Content=")"/>
|
||||
|
||||
<!-- The Numberpad -->
|
||||
<local:NumberPad x:Name="NumberPad"
|
||||
x:Uid="NumberPad"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="4"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="3"
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}"/>
|
||||
|
||||
<controls:CalculatorButton x:Name="PlotButton"
|
||||
x:Uid="plotButton"
|
||||
Grid.Row="5"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource AccentCalcButtonStyle}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ButtonId="Plot"
|
||||
Content=""/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -0,0 +1,51 @@
|
||||
|
||||
#include "pch.h"
|
||||
#include "GraphingCalculator.xaml.h"
|
||||
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
|
||||
#include "Controls/CalculationResult.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::Common;
|
||||
using namespace CalculatorApp::Controls;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace concurrency;
|
||||
using namespace GraphControl;
|
||||
using namespace Platform;
|
||||
using namespace std::chrono;
|
||||
using namespace Utils;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::Storage::Streams;
|
||||
using namespace Windows::System;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Media::Imaging;
|
||||
|
||||
constexpr auto sc_ViewModelPropertyName = L"ViewModel";
|
||||
|
||||
GraphingCalculator::GraphingCalculator()
|
||||
{
|
||||
Equation::RegisterDependencyProperties();
|
||||
Grapher::RegisterDependencyProperties();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void GraphingCalculator::GraphingCalculator_DataContextChanged(FrameworkElement^ sender, DataContextChangedEventArgs^ args)
|
||||
{
|
||||
ViewModel = dynamic_cast<GraphingCalculatorViewModel^>(args->NewValue);
|
||||
}
|
||||
|
||||
GraphingCalculatorViewModel^ GraphingCalculator::ViewModel::get()
|
||||
{
|
||||
return m_viewModel;
|
||||
}
|
||||
|
||||
void GraphingCalculator::ViewModel::set(GraphingCalculatorViewModel^ vm)
|
||||
{
|
||||
if (m_viewModel != vm)
|
||||
{
|
||||
m_viewModel = vm;
|
||||
RaisePropertyChanged(StringReference(sc_ViewModelPropertyName));
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "Views\GraphingCalculator\GraphingCalculator.g.h"
|
||||
#include "CalcViewModel/GraphingCalculator/GraphingCalculatorViewModel.h"
|
||||
#include "Views\NumberPad.xaml.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
public:
|
||||
GraphingCalculator();
|
||||
|
||||
OBSERVABLE_OBJECT();
|
||||
|
||||
property CalculatorApp::ViewModel::GraphingCalculatorViewModel^ ViewModel
|
||||
{
|
||||
CalculatorApp::ViewModel::GraphingCalculatorViewModel^ get();
|
||||
void set(CalculatorApp::ViewModel::GraphingCalculatorViewModel^ vm);
|
||||
}
|
||||
|
||||
private:
|
||||
void GraphingCalculator_DataContextChanged(Windows::UI::Xaml::FrameworkElement^ sender, Windows::UI::Xaml::DataContextChangedEventArgs^ args);
|
||||
|
||||
private:
|
||||
CalculatorApp::ViewModel::GraphingCalculatorViewModel^ m_viewModel;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user