This project is read-only.

Reuse Styles

Apr 8, 2013 at 7:44 PM

I'm using WatermarkTextBox control from the Extended WPF Toolkit.
There is a way to reuse the style from TextBox on it?

Apr 8, 2013 at 10:01 PM
When the WatermarkTextBox derives from TextBoxBase you may be able to re-use the style. Something like this might work as a default style for WatermarkTextBox (I did not test this):
<Style BasedOn="{StaticResource {x:Type TextBoxBase}}" TargetType="{x:Type toolkit:WatermarkTextBox}" />
This doesn't take the watermark styling into account though.
Apr 9, 2013 at 3:01 AM

Worked but as you predicted the style of the watermark (the gray text) is not being displayed.
I'm very new to WPF world, do you any clue to help solve this?

Apr 9, 2013 at 7:08 PM
Sure, do you have access to the default WatermarkTextBox style?
Apr 9, 2013 at 8:23 PM
Yes, here is the code
It's open-source too :D

Do you think can be valuable to implement some styles for the Extended WPF Toolkit?

Thanks for the HELP!
Apr 9, 2013 at 11:37 PM
Providing mui styles for extended WPF controls is a great idea. The only thing that I want to avoid is adding a toolkit dependency to mui. Having seperate toolkit styles don't seem to be a problem. I'll look into it