wpf - DevExpress and SimpleMvvmToolkit - Serialization error -


i have devexpress dxgrid bound observablecollection of viewmodels (based on simplemvvmtoolkit). viewmodel has 2 properties exposed (a string , boolean) , few other properties exposed base class (viewmodeldetailbase), 1 of them model behind viewmodel.

everytime use grid modify contents of 1 of properties (e.g. boolean value), error saying "the type xxx cannot serialized.." (xxx type of model) followed suggestion use datacontractattribute circomvent issue. not sure how , solution. maybe should read on it, why serialization needed here??

anyway, hope can shed light on this. i'd appreciate pointers me looking in right direction.

edit: since situation intricate post relevant code here, made sandbox project reproduces error. can find via this wetransfer link.

best regards, ~rob

thanks great of simple mvvm toolkit community found out solution simple.

in simple mvvm toolkit, viewmodel needs serializable because gets cloned. roll-back data when action canceled. reason viewmodel not cloned whas because "model" property missing default (parameter-less) constructor.

there's no need decorate viewmodel , properties [datacontract] or [datamember].

i hope helps others.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -