Reputation: 70307
WPF: How do I prevent users from entering text in a Textbox data bound to a numeric property?
Upvotes: 1
Views: 1429
Reputation: 564413
The standard validation will handle this...
You can also use a Behavior or attached property to override TextBox's input to prevent non-numeric numbers from being entered. Here is a sample behavior that does this.
Upvotes: 2