|
Can someone point me to a decent tutorial on how to override a WPF TextBox? I tried Googling, but the answers are all over the board. not sure what I'm looking for. I just want to add various functionality, and I'm looking for a starting point
If it's not broken, fix it until it is
|
|
|
|
|
This MSDN paper[^] explains the basics. You just need to add the parts that are specific to your needs.
Use the best guess
|
|
|
|
|
If you think you need to override a WPF control, you are almost always wrong. WPF allows you to attach behaviour to existing controls using Blend Behaviors.
|
|
|
|
|
Well, Like I said, I'd like to add functionality that's not there, so I don't know how that means I'm wrong. It's really extending the textbox that I want. I just don't know how to do it in WPF.
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
In WPF, it's normal to prefer composition over inheritance. Here's[^] an example of extending the TextBox without actually doing any overriding. This is a very powerful technique.
|
|
|
|