我有一个带有ComboBox和TextBox的wpf窗口(以及许多与此无关的其他内容),并且我正在尝试为Textbox编写验证例程. 在我的XAML中,我有:
I have a wpf window with a ComboBox and a TextBox (and lots of other stuff not relevant here) and I am trying to write a validation routine for the Textbox. In my XAML I have:
<TextBox> <Binding Path="Charge" UpdateSourceTrigger="Explicit"> <Binding.ValidationRules> <abc:VT /> </Binding.ValidationRules> </Binding> </TextBox>其中VT是我的验证例程,而"abc"是我的验证例程是一个程序集,其中包含项目中使用的所有验证例程,并且在我的项目参考中. 我遇到的问题是,VT需要知道ComboBox的SelectedValue才能知道如何执行验证.如何将这些数据导入VT?
where VT is my validation routine and "abc" is an assembly that contains all the validation routines used in the project and is in my Project References. The problem I'm having is that VT needs to know the SelectedValue of the ComboBox in order to know how to perform the validation. How do I get that data into VT?
推荐答案
我有一个带有ComboBox和TextBox的wpf窗口(以及许多此处不相关的其他内容),并且我正在尝试为Textbox编写验证例程.
I have a wpf window with a ComboBox and a TextBox (and lots of other stuff not relevant here) and I am trying to write a validation routine for the Textbox.
有关WPF的问题应在中提出 Windows Presentation基金会(WPF) 论坛.
Questions relating to WPF should be asked at the Windows Presentation Foundation (WPF)forum.
更多推荐
将参数传递给验证例程
发布评论