title: Custom Tool tip on Data Trigger
body: <p>This is my working <code>XAML</code> code for a tooltip:   </p>
  
  <pre><code> &lt;DataTrigger Binding="{Binding Visibility,ElementName=txtParent}" Value="Visible"&gt;
         &lt;Setter Property="StackPanel.ToolTip" Value="{Binding Text,ElementName=txtParent}" TargetName="PanelTitle"&gt;
         &lt;/Setter&gt;   
   &lt;/DataTrigger&gt;
  </code></pre>
  
  <p>Now I want a tool tip which has maximum width as well as text wrapping. I tried using the following code but it didnt work: </p>
  
  <pre><code> &lt;DataTrigger Binding="{Binding Visibility,ElementName=txtParent}" Value="Visible"&gt; 
       &lt;Setter Property="StackPanel.ToolTip" TargetName="PanelTitle"&gt;
             &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type ToolTip}"&gt;
                  &lt;StackPanel Margin="7,1"&gt;                                               
                     &lt;TextBlock Text="{Binding Text,ElementName=txtParent}"  Margin="1" HorizontalAlignment="Center"                          Width="200"                         TextWrapping='Wrap' VerticalAlignment="Top" /&gt;                                               
                  &lt;/StackPanel&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
       &lt;/Setter&gt;
   &lt;/DataTrigger&gt;
  </code></pre>