0
votes

I'm using Catel MVVM with WPF. I have a ViewModel using a Model which is decorated using the [Model] attribute. The Model inherits from ModelBase.

public class PartEditViewModel : ViewModelBase
{
    [Model]
    [Expose("Number")]
    [Expose("Description")]
    public Part Part{ get; set; }
 ...

TextBoxes are bound to the exposed properties to edit them. I'd like to have a button to reset changes to this model. I've tried calling CancelAsync which fires OnDeserializing of this Model, but the properties in the ViewModel are not updated to their original value.

How can I achieve the desired behaviour?

1

1 Answers