按钮单击WPF时如何验证空文本框?

问题描述:

我是wpf的新手,我想在用户点击按钮将数据存储到数据库时留下任何空文本框的错误消息进行验证

i需要简单的步骤才能做到这一点因为我花了我所有的时间3天寻找简单的代码与简单的例子,但我不明白

请任何人都可以轻松地帮助我,因为我是wpf的新手,或者任何人有想法离开文本框时显示错误空我需要它在VB中wpf而不是C#



我尝试了什么:



请允许任何人以简单的方式帮助我,因为我是wpf的新手,或者任何人都有想法在离开文本框时显示错误空我需要它在VB中wpf而不是C#

i'm new in wpf and i want to make validation with error message on any empty text box user left when he click button to store data to database
i need simple steps to do that because i spend all my time for 3 days searching for simple code with simple example but I did not understand it
Please can anyone help me in an easy way because I'm new in wpf or anyone has an idea to display error when leaving the text box Empty I need it in VB wpf not C#

What I have tried:

Please can anyone help me in an easy way because I'm new in wpf or anyone has an idea to display error when leaving the text box Empty I need it in VB wpf not C#

参见 WPF:初学者指南 - n的第1部分 [ ^ ]和以下文章,以及Sacha Barber的其他任何内容。
See WPF: A Beginner's Guide - Part 1 of n[^] and the following articles, plus anything else by Sacha Barber.