msft-calculator/src/CalcViewModel/GraphingCalculator/GraphingCalculatorViewModel.h
Pepe Rivera 28dbdb3d94
Persist variable settings after graph is plotted (#1055)
* Allow copying graph as image

* Persist variables

* Revert "Allow copying graph as image"

This reverts commit 4fc9d798bc.

* fix binding bug

* undo cert change

* fix animation

* remove extra lines

* remove overrides

* undo key comment
2020-03-17 11:27:00 -07:00

33 lines
1.3 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "../Common/Utils.h"
#include "EquationViewModel.h"
#include "VariableViewModel.h"
namespace CalculatorApp::ViewModel
{
[Windows::UI::Xaml::Data::Bindable] public ref class GraphingCalculatorViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
GraphingCalculatorViewModel();
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_R(bool, IsDecimalEnabled);
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<EquationViewModel ^> ^, Equations);
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<VariableViewModel ^> ^, Variables);
OBSERVABLE_PROPERTY_R(EquationViewModel ^, SelectedEquation);
COMMAND_FOR_METHOD(ButtonPressed, GraphingCalculatorViewModel::OnButtonPressed);
event Windows::Foundation::EventHandler<VariableChangedEventArgs> ^ VariableUpdated;
void UpdateVariables(Windows::Foundation::Collections::IMap<Platform::String ^, GraphControl::Variable ^> ^ variables);
void SetSelectedEquation(EquationViewModel ^ equation);
private:
void OnButtonPressed(Platform::Object ^ parameter);
};
}