mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-16 02:02:51 -07:00
GraphControl: refactoring and optimizations (#831)
* GraphControl cleaning * replace textbox value after submission * rebase * rebase * rebase * Add filters * rebase! * rebase
This commit is contained in:
parent
da38b5a015
commit
534139d67d
33 changed files with 1169 additions and 1393 deletions
|
@ -15,27 +15,30 @@ namespace CalculatorApp::ViewModel
|
|||
{
|
||||
GraphingCalculatorViewModel::GraphingCalculatorViewModel()
|
||||
: m_IsDecimalEnabled{ true }
|
||||
, m_Equations{ ref new Vector< EquationViewModel^ >() }
|
||||
, m_Variables{ ref new Vector< VariableViewModel^ >() }
|
||||
, m_Equations{ ref new Vector<EquationViewModel ^>() }
|
||||
, m_Variables{ ref new Vector<VariableViewModel ^>() }
|
||||
{
|
||||
}
|
||||
|
||||
void GraphingCalculatorViewModel::OnButtonPressed(Object^ parameter)
|
||||
void GraphingCalculatorViewModel::OnButtonPressed(Object ^ parameter)
|
||||
{
|
||||
}
|
||||
|
||||
void GraphingCalculatorViewModel::UpdateVariables(IMap<String^, double>^ variables)
|
||||
void GraphingCalculatorViewModel::UpdateVariables(IMap<String ^, double> ^ variables)
|
||||
{
|
||||
Variables->Clear();
|
||||
for (auto var : variables)
|
||||
{
|
||||
auto variable = ref new VariableViewModel(var->Key, var->Value);
|
||||
variable->VariableUpdated += ref new EventHandler<VariableChangedEventArgs>([this, variable](Object^ sender, VariableChangedEventArgs e)
|
||||
{
|
||||
VariableUpdated(variable, VariableChangedEventArgs{ e.variableName, e.newValue });
|
||||
});
|
||||
variable->VariableUpdated += ref new EventHandler<VariableChangedEventArgs>([this, variable](Object ^ sender, VariableChangedEventArgs e) {
|
||||
VariableUpdated(variable, VariableChangedEventArgs{ e.variableName, e.newValue });
|
||||
});
|
||||
Variables->Append(variable);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void GraphingCalculatorViewModel::SetSelectedEquation(EquationViewModel ^ equation)
|
||||
{
|
||||
SelectedEquation = equation;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue