问题
I am new to WPF. I need to create textboxes which is only accept digits. Not accepted any special characters, letters .
And the important thing is , the code is only xaml not c#.
I googled lot of websites , but i only get the code used c#. But i want in XAML code. Because i enclosed it like styles in controls.
Is there any way to do this? And if it is not possible Why?
回答1:
No, it's not possible because XAML is a markup language. It has no support for distinguishing between digits and other type of characters.
You should use a programming language such as C# to implement this kind of logic.
来源:https://stackoverflow.com/questions/60265339/is-there-a-way-to-create-numberic-textboxes-using-wpf-xaml-code