This is a migrated thread and some comments may be shown as answers.

Newbie Question on Telerik and MVVM

1 Answer 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 01 Aug 2019, 04:44 AM

Hi,

I'm new to Telerik. In learning MVVM, I've been religiously separating the ViewModel and Model. However, when looking at Telerik examples, such as those for RadDataForm, it appears that only one model class is used, and that it is bound directly to the View. The notes state that if I want to use change notification, I should implement INotifyPropertyChanged, which I typically do in the ViewModel. So, for best practice,should I split the sample class into a Model and ViewModel at this point?

On a related note, I've been implementing IDataNotifyError in my test apps, but it appears that I can tap into Telerik's simplified validation model. So let me turn this this into a broader question. For a thorough understanding, I've been trying to reconcile Telerik's approach to the lessons/rules I've adopted from various WPF textbooks. Is this an easier way to do this, or should I abandon that goal and simply do things the Telerik way?

Wayne

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 05 Aug 2019, 03:01 PM
Hello Wayne,

It is good to hear that you are following the MVVM pattern. That said, note that not all of the available examples with the Telerik controls are set up according to it for simplicity's sake. With this in mind, it is up to you to decide how to setup up your data models and where to implement INotifyPropertyChanged depending on the exact scenario.

As for the validation, the benefits of using the INotifyDataErrorInfo would be that if you visualize the data in another control(s) that respect(s) this interface (for example RadGridView), you won't have to duplicate code. 

I hope you find this information helpful.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
n/a
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or