0. viewmodel의 필수 reference.
using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using DevExpress.Mvvm.POCO;
1. ViewModelBase or BindableBase 의 상속이 필요X
2. binding 할 value는 virtual으로 , 생성자는 protected로 , Create method를 만들것.

3. dxmvvm 추가. ViewModels 추가(NameSpace 추가) . DataContext 로 ViewModels 에 속한 Viewmodel지정

=============================================================================================
4. 상속받는 extension을 필요로 할때 생성 - 원래viewmodel 과 INotifyPropertyChanged상속 받고, virtual value를 override , parent에서 상속받은 command 를 갖는 delegateCommand를 만듦.

5. 람다식이나 delegate로 파라미터를 viewmodel생성자로 보냄.


예)https://documentation.devexpress.com/WPF/17352/MVVM-Framework/View-Models/POCO-ViewModels
xaml에서 command bind시 function이름 뒤에 Command로 지정.


https://github.com/DevExpress-Examples/how-to-use-the-poco-mechanism-e5167/tree/17.1.3%2B/CS
git 예제
DevExpress-Examples/how-to-use-the-poco-mechanism-e5167
.NET, WPF, MVVM Framework. Contribute to DevExpress-Examples/how-to-use-the-poco-mechanism-e5167 development by creating an account on GitHub.
github.com
6. Property가 변경될때 실행할 function 만들기.
On + Property이름 + Changed ,
On + Prorperty이름 + Changing

7. BindableProperty 어트리뷰트사용.

8. Fluent API 사용

9.
ViewModel relationships (ISupportParentViewModel)
ViewModel relationships (ISupportParentViewModel) | WPF General | WPF Controls | DevExpress Help
View Models inherited from ViewModelBase can be related to each other with a parent-child relationship. This is achieved with the ISupportParentViewModel interface, implemented in the ViewModelBase class. If you use the POCO mechanism, the ISupportParentVi
documentation.devexpress.com




댓글