I'd like to have a WPF control that automatically transforms its text in uppercase. I don't want to add any other function to the WPF's textblock.
So I thought I could create a class like this :
public class UpperTextBlock : TextBlock
{
static UpperTextBlock()
{
}
public UpperTextBlock()
{
}
}
I just wanted to add an event on "textchanged" and once the text changes just put it in uppercase, but I didn't find the equivalent of "textchanged". How could I do ?
Thank you !
EDIT after first answers
I would like to use my custom control in all my templates and not only for a particular textblock, that's why a converter or something like the first answer isn't enough generic for me.