开发者

How to create WPF UserControl in MVVM

I have one doubt in MVVM, What is the procedure to create UserControl Example EmunRadioButton.

Public class EmunRadioButton: RadioButton. 
{
//code
}

My Question is: where to create this EmunRadioButt开发者_如何学运维on class that is ( View , ViewModel or Model); Please give the hint


I dont think this is UserControl. More like CustomControl.

In UserControl, its basicaly multiple controls put together. In CustomControl, you either create or modify completly new control.

In both cases, it would be little wrong to try to put MVVM into this. Especialy because you need to use Dependency properties to expose state of your new control. This way you can use MVVM when you put your control in another View.


Since this class is derived from a View related class, and doesn't touch your model directly I personally would put the file (XAML or code file) in my View folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜