user517206
user517206

Reputation: 161

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 EmunRadioButton class that is ( View , ViewModel or Model); Please give the hint

Upvotes: 0

Views: 687

Answers (2)

Euphoric
Euphoric

Reputation: 12849

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.

Upvotes: 2

BrokenGlass
BrokenGlass

Reputation: 160892

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.

Upvotes: 1

Related Questions