MVVM - RaisePropertyChanged turning code into a mess

前端 未结 5 1987
萌比男神i
萌比男神i 2021-01-12 00:08

New to MVVM so please excuse my ignorance.

I THINK i\'m using it right but I find my ViewModel has too many of these:

RaisePropertyChanged(\"SomeProp         


        
5条回答
  •  生来不讨喜
    2021-01-12 00:30

    You could use PostSharp's NotifyPropertyChanged attribute. Then all you have to do is to put an attribute on the class and that's it. E.g.:

    [NotifyPropertyChanged]
    public class MyClass 
    {
        public string MyProperty { get; set; }
    }
    

提交回复
热议问题