I have around 10 textboxes using the same events - I then just cast sender to a textbox and make whatever changes I'm going to make to the text. I'm curious, is there an easier/cleaner way to assign those events to the code-behind methods? Right now, I'm doing it by just assigning each event the method, repeatedly, to each textbox.
Is there anything that can be done with templates or anything? Below is what's on every single TextBox. It's all just copying and pasting, but it's a lot of extra lines of code and I'd like to avoid it if there's a WPF solution to do so.
...
LostFocus="textBox_LostFocus"
MouseDoubleClick="selectText"
GotKeyboardFocus="selectText"
PreviewMouseLeftButtonDown="selectivelyIgnoreMouseButton" />
Thanks in advance.