Welcome to the XSharp News Server and Forum

You are welcome to participate in the XSharp newsgroups and forum.

The XSharp News Server can be found at news.xsharp.info, port 119 (nntp). You can login with the user name XSharpUser and password X#Rulez!.
You can also post through the web interface. In that case you need to create a user account first.
The newsgroups and web interface are not synchronized yet. We are working on that.

When posting to the newsgroups and forums we ask you kindly to follow the rules that you can find here: https://www.xsharp.info/faq/39-xsharp-news-server-rules

HELP ! - with MVVM and binding ....

More
1 week 1 day ago #1 by Nick Friend
Hi Phil,

I'm not sure I can be of much use to you with this. I use IDataErrorInfo for validation, in which case it's all handled at the ViewModel or individual data object level.

Masking is a separate issue - since that's basically visual it makes sense to handle it in the view (in the xaml).

If you Google "ValidationRule vs IDataErrorInfo" you get several useful articles discussing the pros and cons.

Nick

Please Log in to join the conversation.

More
1 week 1 day ago #2 by Phil Hepburn
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.
Attachments:

Please Log in to join the conversation.

Time to create page: 2.594 seconds