0
Entlib 5.0でWPFでのユーザー入力を検証しようとしています。テキストボックスの値が数値かどうかをチェックしたいEntlib 5.0での非テキストプロパティのWPF検証
マイモデル:
public class Customer
{
[Required(ErrorMessage = "Country is required")]
public double Country { get; set; }
}
XAML:
<TextBox>
<TextBox.Text>
<Binding Path="Country" UpdateSourceTrigger="PropertyChanged" >
<Binding.ValidationRules>
<vab:ValidatorRule ValidationSpecificationSource="All" SourceType="{x:Type bl:Customer}" SourcePropertyName="Country"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
私はValidation.HasErrorがfalseに設定されているtexboxするテキストを設定しています。
どのように私はこの状況を検証することができますどのようなアイデア。
クイック回避策は、文字列プロパティとして値を公開して文字列を解析することであるが、それは理想的ではありません。 – baalazamon