-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Store LocalValues directly without creating a PriorityValue. #1703
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
Conversation
Instead of using a `PriorityValue`, when a property is assigned a simple `LocalValue` just store the value directly in the value store.
|
@grokys I get this error: |
|
It also throws when property is really missing, which I think is good 👍 The TitleBarContent is really missing. |
|
@grokys Other than the issue I have reported with property PR looks good. |
wieslawsoltes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with Core2D and all works now (fixes Core2D issues by refactoring property definitions and adding missing properties).
|
@wieslawsoltes The error you're getting on that |
There are lots of cases of styled properties that have only a local value. Currently we are creating a
PriorityValuefor each set property on anAvaloniaObject, even if it is to store just a single local value.This PR changes that: when a property has just a single local value it will be stored directly without creating a
PriorityValue. When the property is bound to, or when a non-LocalValueis assigned to it, then aPriorityValuewill be created as before.This PR refactors the value dictionary into a
ValueStoreclass to make this manageable. The overhead of this is non-zero, but in the figures below only represents about 0.5mb. I think this is an acceptable overhead for the sake of maintenance (yes, I did try a version where the code to manage this was placed directly inAvaloniaObject).Memory Usage
Memory usage was measured via the VS2017 diagnostic tools by running ControlCatalog in Release mode, opening all pages and then taking a memory snapshot:
Note that this PR depends on #1695:
On #1695:
This PR:
Depends on #1695