Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Something like this might work for you:</p> <pre><code> &lt;ItemsControl Grid.Row="1" ItemsSource="{Binding Summary}" Margin="0,3,0,0"&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBlock x:Name="TheTextBlock" Style="{StaticResource TooltipLeftColumnTextStyle}" Text="{Binding Name}" /&gt; &lt;TextBlock Style="{StaticResource TooltipRightColumnTextStyle}" Text="{Binding Value}" /&gt; &lt;Border Grid.Row="1" Style="{StaticResource TooltipSeparatorBorder}" /&gt; &lt;Border Grid.Row="2" Style="{StaticResource TooltipSeparatorAlternateBorder}" /&gt; &lt;/Grid&gt; &lt;DataTemplate.Triggers&gt; &lt;DataTrigger Binding="{Binding NameType}" Value="1"&gt; &lt;Setter TargetName="TheTextBlock" Property="Text" Value="{Binding Name1}"/&gt; &lt;/DataTrigger&gt; &lt;DataTrigger Binding="{Binding NameType}" Value="2"&gt; &lt;Setter TargetName="TheTextBlock" Property="Text" Value="{Binding Name2}"/&gt; &lt;/DataTrigger&gt; &lt;/DataTemplate.Triggers&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; </code></pre> <p>Otherwise, the other option is to control the value of the bound Name in the ViewModel so that Name returns the value you want. When NameType changes, you would raise the PropertyChanged event with the parameter "Name" on the view model so that the UI becomes aware of the text change.</p>
    singulars
    1. This table or related slice is empty.
    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. 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