How to get back to the default foregound themed brush?

Ribbon for WPF Forum

The latest build of this product (v21.1.1) was released 3 months ago, which was before this thread was created.
Posted 21 days ago by Procam
Version: 21.1.1
Avatar

Hi,

I have a form with more textboxes with default foreground in theme Metro.Dark. For some reason (to signalize the text was modified), I had to change the foreground to another brush. Later, I need again to set the default foreground even the theme was changed to Metro.Light in the meantime. How to get the default foreground color? Thx!

Comments (1)

Posted 21 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

TextBox controls in our themes currently have this default Foreground:

<Setter Property="Foreground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ContainerForegroundLowNormalBrushKey}}" />

You'd need to do something like this to reestablish the DynamicResource via code:

textBox.SetResourceReference(TextBox.ForegroundProperty, AssetResourceKeys.ContainerForegroundLowNormalBrushKey);


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.