My question is related to this question.
This question is quite outdated, and the answer is more, and it seems that it is a bit missing. The user created the control from scratch, which is somewhat lacking, but the most important thing is that it does not feel that it should be necessary (at least to me) in order to create a completely new control in order to have a TextBlock that can support stroking ( outlined) text.
I am trying to extend a TextBlock control by providing a Brush property and a double property. I was hoping I could override the OnRender method, but it is sealed, so I cannot.
This is what I have so far (this is not so much):
public class StrokedText: TextBlock { public static readonly DependencyProperty StrokeProperty = DependencyProperty.Register( "Stroke", typeof( Brush ), typeof( StrokedText ), new PropertyMetadata( Brushes.Red, ( S, E ) => ( S as StrokedLabel ).InvalidateVisual( ) ) ), StrokeWidthProperty = DependencyProperty.Register( "StrokeWidth", typeof( double ), typeof( StrokedText ), new PropertyMetadata( 2.0D, ( S, E ) => ( S as StrokedLabel ).InvalidateVisual( ) ) );
I spent some time looking at the TextBlock control to keep track of where it actually displays the string as text on the screen (I decided if I could find that I could copy the method), but I was hoping someone could happen that they already know the answer and save me some time, because the TextBlock control is just ... crazy.
So - is it possible to expand this TextBlock so that I can stroke the text as I want?
EDIT 1:
For clarity, there seems to have been a misunderstanding as to what I'm going to - I don't care about the presentation of the text block. I want to highlight TEXT .