HELP ! - with MVVM and binding ....
Posted: Tue Feb 14, 2017 12:04 pm
Hi guys,
I guess I am probably talking with Nick (Friend) in asking you all for some help and guidance.
As you may be aware, I have been doing a lot recently with coding in X# WPF forms to handle data validation. And as such I have been creating Validation Rule classes and applying them to XAML script in my mark-up section.
Here is how we switch-on the VR to be used :-
This works - BUT - as you will have noticed Nick does not play to the rules of the MVVM pattern of approach. We are using a names pace in the XAML script header - see below :-
to access directly a .NET class in my code files with namespace 'MyClasses'. Two more small images show this below :-
Now then Nick / guys, what I need to know is that if I use the MVVM light framework, can I bind the class to the TextBox and have it behind in the ViewModel in some way ?
I know you use the DevExpress controls and this may do stuff for you, BUT, are you at least aware of this way I can clean things up MVVM wise ?
TIA,
Phil.
Wales, UK.
I guess I am probably talking with Nick (Friend) in asking you all for some help and guidance.
As you may be aware, I have been doing a lot recently with coding in X# WPF forms to handle data validation. And as such I have been creating Validation Rule classes and applying them to XAML script in my mark-up section.
Here is how we switch-on the VR to be used :-
This works - BUT - as you will have noticed Nick does not play to the rules of the MVVM pattern of approach. We are using a names pace in the XAML script header - see below :-
to access directly a .NET class in my code files with namespace 'MyClasses'. Two more small images show this below :-
Now then Nick / guys, what I need to know is that if I use the MVVM light framework, can I bind the class to the TextBox and have it behind in the ViewModel in some way ?
I know you use the DevExpress controls and this may do stuff for you, BUT, are you at least aware of this way I can clean things up MVVM wise ?
TIA,
Phil.
Wales, UK.