This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Saving to binary for UIElement ends up working not quite like the others, because they rely on going through the data that's been written and removing values that are defined by the set style, which you can't really do with the binary serialization. I could add so that UIElement overrides the saving from Animatable and Serializable in order to make it do this, but it seemed like a lot of work for something that probably won't be used. In practice, the difference is that when saving to binary it saves all attributes, while the other formats remove ones that are defined by the style while leaving ones set in addition to those (if I understand it right).
I wanted the binary writing in the first place just because I didn't really want to write and read from XML to copy UI in app, it just felt wrong. Animatable came as a side thing to that since it's the parent to UIElement. The JSON implementation was also an aside, it just made no sense to me to not have all the implementations (JSON should work the same as XML load and save does).
Also as a last note, Menu has a custom save function as well, but I left it out for now.