Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Using Data annotation in MVC is so easy. I wonder how i could do the same in WPF. Any ideas.
I Searched and saw all sorts of interface implementation INotifyDataErrorInfo, INotifyPropertyChanged etc. Is there any way that restricts coding to wpf designer and form code behind?????
Posted
Comments
Sergey Alexandrovich Kryukov 22-Jul-14 12:04pm    
Who told you it is inapplicable to WPF?! First of all, the second interface has nothing to do with validation.
Read about data binding, and you will see.
And who told your about "restricting to WPF designer"..?

You see, I can see some big problem with WPF, but first of all, you need to have some general understanding of how it works and how the development can be done. Your question is negative and hence hard to answer. If you asked about some particular problems, many would give you an advice, and, depending on what the problem is, many suggestions would use one of those interfaces. But how to answer your question? Using one or another interface is not a purpose.

—SA

1 solution

Please see my comment to the question where I explain why it would be difficult to answer your question. This is not a productive question, because you don't ask about anything certain, you just "want" WPF to be similar to ASP.NET MVC. This is not reasonable. WPF has its own ways you just need to understand.

As to the interfaces you mentioned, just look here:
http://bit.ly/1p6M2FU[^],
http://bit.ly/1p6MfJj[^].

As you can see, your complain about these interface was baseless. But I don't want to go in for further detail, because you did not formulate any certain problem with WPF.

Now, pay attention that for WPF it is more typical to implement MVVM rather then MVC. MVVM was developed having WPF in mind:
http://en.wikipedia.org/wiki/MVVM[^].

However, nothing prevents anyone from using MVC with WPF. Only you should make sure that you don't have too narrow understanding of the term "MVC". First of, all, this is the architecture (not just some framework on top of ASP.NET):
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900