markzzz
markzzz

Reputation: 47995

How can I change the watermark "color?

Hers's my basic setting for a TextBox:

<TextBox x:Name="NomeRapporto"
         Text="{Binding NomeRapporto}"
         controls:TextBoxHelper.Watermark="Nome Rapporto"
         controls:TextBoxHelper.UseFloatingWatermar="True" />

which render this way empty:

enter image description here

And when I insert a text manually via the interface, it appears like this:

enter image description here

As you can see, when focused, there is that "blue" color. How can I change to (for example) red?

Thanks

Upvotes: 0

Views: 144

Answers (1)

mm8
mm8

Reputation: 169370

Define a custom MahApps.Brushes.TextBlock.FloatingMessage resource:

<TextBox x:Name="NomeRapporto"
         Text="{Binding NomeRapporto}"
         controls:TextBoxHelper.Watermark="Nome Rapporto"
         controls:TextBoxHelper.UseFloatingWatermark="True">
    <TextBox.Resources>
        <SolidColorBrush x:Key="MahApps.Brushes.TextBlock.FloatingMessage" Color="Red" />
    </TextBox.Resources>
</TextBox>

Upvotes: 2

Related Questions