Issue with Dependency property & custom TextBox
<p>I want to create custom text box (which will contain simple watermark/hint text) and I some reached problems with dependecy properties. 
My custom class inherits from TextBox class and consist of two files (.xaml .cs)
C# code file is very simple:</p>

<pre><code>public partial class HintTextBox : TextBox
{
    public string HintText
    {
        get { return (string)GetValue(HintTextProperty); }
        set { SetValue(HintTextProperty, value); }
    }
    public static readonly DependencyProperty HintTextProperty =
        DependencyProperty.Register(
            "HintText",
            typeof(string),
            typeof(HintTextBox),
            new FrameworkPropertyMetadata(string.Empty));
}
</code></pre>

<p>.xaml file contains code which show/hide watermark </p>

<pre><code>&lt;local:HintTextBox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:Ribes.Client.GUI"
                xmlns:sys="clr-namespace:System;assembly=mscorlib"&gt;
&lt;local:HintTextBox.Style&gt;
    &lt;Style TargetType="{x:Type local:HintTextBox}"&gt;
        &lt;Style.Resources&gt;
            &lt;VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center" Stretch="None"&gt;
                &lt;VisualBrush.Visual&gt;
                    &lt;Label Content="{Binding HintText, ElementName=local:HintTextBox}" Foreground="LightGray" /&gt;
                &lt;/VisualBrush.Visual&gt;
            &lt;/VisualBrush&gt;
        &lt;/Style.Resources&gt;
        &lt;Style.Triggers&gt;&lt;!-- triggers changing content of control --&gt;&lt;/Style.Triggers&gt;
    &lt;/Style&gt;
&lt;/local:HintTextBox.Style&gt;
</code></pre>

<p></p>

<p>I'm trying to obtain simple usage of my HintTextBox:</p>

<pre><code>&lt;local:HintTextBox HintText="hint text"&gt;&lt;/local:HintTextBox&gt;
</code></pre>

<p>And it's does not work. 
After create brakepoint on line :</p>

<pre><code>SetValue(HintTextProperty, value);
</code></pre>

<p>code is never reached. Inherited properties (Text,Background) of TextBox works fine:</p>

<pre><code>&lt;local:HintTextBox Text="example text" Background="Yellow"&gt;&lt;/local:HintTextBox&gt;
</code></pre>

<p>We can see correct yellow TextBox with 'example text' inside.</p>

<p>Have anybody idea what can be wrong with my DP ?</p>

<p>Regars
NQ</p>