observable - How to serialize ObservableCollection in C#? -
i have observable collection "ob" needs serialized before can sent print functionality.
i received suggestion make class stated below
public class obcollection : observablecollection<viewmodel> { }
and use obcollection in place of "ob" not works.
any suggestions on this?
i've tried below things:
- marking class serializable.
- marking observable collection data member.
- adding parameterless constructor in class off observable collection part.
observablecollection<t>
implements ienumerable<t>
should able convert list<t>
or t[]
enough tolist()
/toarray()
extensions. both of can serialized datacontractserializer
without issue (as long attributes applied).
Comments
Post a Comment