Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can (mis?)use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.tag.aspx" rel="nofollow">Tag</a> property to store the title on the <code>ContentControl</code></p> <pre><code>&lt;ContentControl Style="{StaticResource PopupContentStyle1}" Tag="Sample Title" &gt; ... &lt;/ContentControl&gt; </code></pre> <p>And in your style set it with <code>TemplateBinding</code> to your label content</p> <pre><code>&lt;Label Name="popupTitle" Content="{TemplateBinding Tag}" ... /&gt; </code></pre> <p>Or as an alternative solution you can use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.headeredcontentcontrol.aspx" rel="nofollow">HeaderedContentControl</a> which have a built in <code>Header</code> property what you can use as the popup title. </p> <p>So if you don't need any additional functionality there is no need to create your own "PoupContentControl" because the built in <code>HeaderedContentControl</code> gives you the ability to use a <code>Header</code> in your Style:</p> <p>A sample with using</p> <pre><code>&lt;Popup x:Name="p1" AllowsTransparency="True" IsOpen="True" &gt; &lt;HeaderedContentControl Style="{StaticResource PopupContentStyle1}" Header="Sample title"&gt; &lt;HeaderedContentControl.Content&gt; &lt;Grid&gt; &lt;TextBox&gt;Popup user control goes here&lt;/TextBox&gt; &lt;/Grid&gt; &lt;/HeaderedContentControl.Content&gt; &lt;/HeaderedContentControl&gt; &lt;/Popup&gt; </code></pre> <p>And in your stlye change the <code>TargetType</code> to <code>HeaderedContentControl</code> and modify your <code>Label</code> to:</p> <pre><code>&lt;Label Name="popupTitle" Content="{TemplateBinding Header}" ... /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload