Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphControl: refactoring and optimizations #831

Merged
merged 9 commits into from
Dec 14, 2019
Merged

GraphControl: refactoring and optimizations #831

merged 9 commits into from
Dec 14, 2019

Conversation

rudyhuyn
Copy link
Contributor

@rudyhuyn rudyhuyn commented Nov 27, 2019

Description of the changes:

Full refactoring of Equation to use only normal properties instead of dependency properties

Refactor GraphingControl

  • The EquationViewModel used for KeyGraphFeatures is now hosted by GraphingCalculatorViewModel instead of GraphControl

Refactor VariableViewModel to not use PropertyChanged as an internal event

  • modify Min and Max even when Value is modified using the property
  • remove OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged)
  • replace the property Value and the method SetValue
  • replace OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY by OBSERVABLE_PROPERTY_RW
  • extract VariableViewModel from GraphingCalculatorViewModel.cpp

Also

  • use a Color instead of a SolidColorBrush for LineColor allowing us to remove the workaround using a blankBrush in EquationInputArea
    equationViewModel->LineColor = AvailableColors->GetAt(m_lastLineColorIndex);
  • extract KeyGraphFeatures from Equation
  • made many properties read-only
  • rename EquationInputAreaControl.EquationVM as EquationInputAreaControl.SelectedEquation
  • replace GraphControl::PropertyChangedEventHandler by the standard PropertyChangedEventHandler

How changes were validated:

  • manually

@@ -11,6 +11,8 @@
// Utility macros to make Models easier to write
// generates a member variable called m_<n>

#define SINGLE_ARG(...) __VA_ARGS__

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO: This is a hack to allow us to use arguments with a comma in macros

@rudyhuyn rudyhuyn marked this pull request as ready for review November 27, 2019 05:52
@HowardWolosky HowardWolosky added the graphing calculator Work items related to the graphing calculator feature. label Dec 2, 2019
Copy link
Contributor

@joseartrivera joseartrivera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left some minor comments, also looks like there are some merge conflicts that will likely require some manual changes. Thanks for working on this!

src/GraphControl/Utils.h Outdated Show resolved Hide resolved
src/GraphControl/Models/KeyGraphFeaturesInfo.h Outdated Show resolved Hide resolved
src/CalcViewModel/Common/Utils.h Show resolved Hide resolved
joseartrivera
joseartrivera previously approved these changes Dec 7, 2019
@rudyhuyn
Copy link
Contributor Author

rebased!

Copy link
Contributor

@EriWong EriWong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buddy test passed and things look good.

@EriWong EriWong merged commit 534139d into microsoft:feature/GraphingCalculator Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphing calculator Work items related to the graphing calculator feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants