如何使用mvvm验证wpf中的Textbox [英] How can I validate Textbox in wpf using mvvm

查看:72
本文介绍了如何使用mvvm验证wpf中的Textbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我尝试验证文本框以获取手机号码,总数位被限制为10.,即(9999900000)。如果用户输入的数量超过10,则应显示弹出窗口或消息。

请发布相关代码,这将有所帮助。

Here I trying to validate textbox for getting mobile number in that the total digits was restricted to 10.,i.e(9999900000).If user enters more than 10 ,the popup or message should be displayed.
Pls post relevant codes it will be helpfull.

推荐答案

查看WPF验证规则。

Windows Presentation Foundation中的验证 [ ^ ]

http://stackoverflow.com/questions/19539492/wpf-textbox-validation-c-sharp [ ^ ]

WPF中的简单验证 [ ^ ]



谷歌快速搜索可能会给你以上结果。
Have a look at WPF Validation rules.
Validation in Windows Presentation Foundation[^]
http://stackoverflow.com/questions/19539492/wpf-textbox-validation-c-sharp[^]
Simple Validation in WPF[^]

A quick search at google might have given you the above results.


这篇关于如何使用mvvm验证wpf中的Textbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆