In a previous post I showed you how to use IDataErrorInfo interface to implement simple validation mechanism in WPF MvvM application. In this post we will try to extend and customize this approach a little.
Windows Presentation Foundation allows us to create our own value converters and use them in XAML bindings. WPF also comes with a set of predefined converters. One of them is BooleanToVisibilityConverter. It this post I will show you how to create own version of this converter with parameter feature supported.
Have you ever straggled with generating and polishing gradient for wpf in xaml? I did many times. Did you use any tool for that, except Visual Studio Property tab? I didn’t. Until I stumble upon Online Gradient Maker.
I wanted to have a reusable email validator since there have been a few cases already where I needed one. Previously I just used the RegularExpressionAttribute but that’s verbose for email. So, without thinking much, I created an attribute that derived from RegularExpressionAttribute and supplied it with a regex I used – that turned out to be a surprise.
So you have a requirement – supply the possibility to create and edit rich formatted text in a web application. Seems pretty straightforward – use a ready editor and you’re done.
Now, add some constraints to that, like – the editor needs to be dead simple because the target user does not care about all that semantic stuff (that’s your job), it needs to perform well and be as intuitive as it gets.
This is a pretty valid requirement and in todays web is pretty common, but as it turns out, there isn’t a lot of maneuvering space here.