cwensley / Portable.Xaml

Portable .NET library for reading/writing xaml files.
Other
157 stars 39 forks source link

Should serialize object #132

Closed cm4ker closed 5 years ago

cm4ker commented 5 years ago

This is new feature for Portable.Xaml.

Then we need to control serialization of ability we have the next instruments:

1) The DesignerSerializationVisibility attribute. 2) We can implement "ShouldSerialize[PropertyName]" method name returns the bool and takes 0 arguments.

Now we can't control the object serialization. This PR add this ability. This is initial implementation and we can discuss this.

cwensley commented 5 years ago

Hey @cm4ker, thanks for doing these changes. Just thinking of this now, would we be at all concerned that a ShouldSerialize() method could potentially pre-exist?

Perhaps we should make this opt-in via an attribute on the class (that could even specify the name of the method or property)?

cm4ker commented 5 years ago

Perhaps we should make this opt-in via an attribute on the class (that could even specify the name of the method or property)?

This is a brilliant idea! I'm make this changes.

cm4ker commented 5 years ago

This is ready for another round of review.

cwensley commented 5 years ago

Looks great!