I want to get the default Style for the TextBlock in the code without adding the default TextBlock Style to the resources in XAML .
I have a method like this:
public TextBlock DrawTextBlockAtPoint(string text, Style style) {
that I want to provide an override that uses the usual TextBlock Style :
public TextBlock DrawTextBlockAtPoint(string text) { var style = GetDefaultStyleForProperty(TextBlock.StyleProperty); DrawTextBlockAtPoint(text, style) }
Is there any way to do this?
Scott
source share