Tag: validationrule

WPF文本框的ValidationRule

我是WPF的新手。在我的UserControl中,我有8个标签及其各自的8个文本框,如下所示: 1.Label : abc 2.Label : def TextBox1 : TextBox2 : 3.Label :xyz 4. Label : ghi Textbox3 : TextBox4 : 这些文本框文本属性中的每一个都应该包含以TextBox1.text各自的标签名称结尾的文本,应该是xxxx.abc , TextBox2.text应该是xxxx.def等等。如果文本框不应该有红色边框。 希望我对细节很清楚。所以我需要为每个文本框编写不同的ValidationRule吗? 你输入的是什么?