I have an
ObservableCollection that I want to save to a binary file. An item in that collection contains a field of a type
System.Windows.Controls.Image so while saving I'm getting an error:
Type 'System.Windows.Controls.Image' in Assembly 'PresentationFramework, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable.
I think I could try to convert an
Image source to a
byte variable and save it but I'd like to also save some Image properties like event handlers that I added or Effects.
It there any easy way to do it? or is it even possible?
convert that image to memory stream go through these links
You would need to provide your own serialization surrogate via the SurrogateSelector. What that serialization surrogate does is entirely up to you.