Recently, I needed to show the history of a field for several user controls. This includes checkboxes, textboxes, comboboxes, date/time pickers, etc. Now, how should one accomplish this?
After some searching on the internet, I found out that behaviors were the way to go. However, I have never ever done anything with behaviors in the past. Just to let you know: I just learned about behaviors 3 hours ago or something like that. So, let’s see how it worked out...
I read some short articles about behavior, for example, this one and this one.
Nice, I can do that as well (at least, I should be able to)! So, I started importing the assembly “System.Windows.Interactivity”. Too bad, it was not on my system. It turned out to be part of the Expression Blend SDK, so I quickly downloaded it and got my very own copy of the assembly.
I quickly wrote my own behavior (which is actually very simple, you can see it in the attached demo application), and then the only thing I had to do is to attach the behavior to the controls. This is the result (of the demo app):
The rest of the time until now (appr. 1,5 hour), I used to write a demo app and this article. It’s a bit short, but I am in quite a hurry for a project which has a deadline, sorry for that.
And remember, these kinds of things are the power of WPF. Imagine doing this in another language...
AuditingBehavior.zip (797.38 kb) [Downloads: 373]