Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I like Neil's solution (found on <a href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/faf81960-ca5d-4256-b08b-cbabc7d5516e/" rel="noreferrer">Josh's post</a> via <a href="http://joshsmithonwpf.wordpress.com/2007/03/18/updating-the-ui-when-binding-directly-to-business-objects-that-are-modified/" rel="noreferrer">the link you provided</a>):</p> <pre><code>&lt;DataTemplate DataType="{x:Type local:MyType}"&gt; &lt;ContentPresenter Content="{Binding}" Name="cp" /&gt; &lt;DataTemplate.Triggers&gt; &lt;DataTrigger Binding="{Binding Path=IsRunning}" Value="True"&gt; &lt;Setter TargetName="cp" Property="ContentTemplate" Value="{StaticResource StopTemplate}" /&gt; &lt;/DataTrigger&gt; &lt;DataTrigger Binding="{Binding Path=IsRunning}" Value="False"&gt; &lt;Setter TargetName="cp" Property="ContentTemplate" Value="{StaticResource StartTemplate}" /&gt; &lt;/DataTrigger&gt; &lt;/DataTemplate.Triggers&gt; &lt;/DataTemplate&gt; </code></pre> <p><strong>Edit:</strong> I couldn't actually get the above code to work, but this works using a style:</p> <p></p> <p> <br> </p> <pre><code> &lt;DataTrigger Binding="{Binding Path=SourceSystem.SourceSystemName}" Value="mysite.com"&gt; &lt;Setter Property="ContentControl.ContentTemplate" Value="{StaticResource mysiteToolbar}" /&gt; </code></pre> <p></p> <pre><code> &lt;DataTrigger Binding="{Binding Path=SourceSystem.SourceSystemName}" Value="mysite2.com"&gt; &lt;Setter Property="ContentControl.ContentTemplate" Value="{StaticResource mysiteToolbar2}" /&gt; </code></pre> <p></p> <pre><code> &lt;/Style.Triggers&gt; </code></pre> <p> </p> <p></p>
    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.
    3. 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