Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF RibbonButton: LargeImageSource and Label not updated via DataTriggers
    primarykey
    data
    text
    <p>I'm puzzled by a peculiar phenomenon in RibbonButton's behavior.</p> <p>Everything works fine when I set the LargeImageSource and the Label statically in XAML:</p> <pre><code>&lt;ribbon:RibbonButton x:Name="ButtonArchive" LargeImageSource="..\Assets\archive_insert.png" Label="{Binding Path=ItemArchiveButton, Source={StaticResource Strings}}"/&gt; </code></pre> <p>But when I try to modify these properties via DataTriggers - nothing seems to be happening. The triggers do work; I can see the other properties - like Command or IsEnabled - set OK in the same trigger. It's just these too...</p> <p>Here's the XAML:</p> <pre><code>&lt;ribbon:RibbonButton x:Name="ButtonArchive" LargeImageSource="..\Assets\archive_insert.png" Label="{Binding Path=ItemArchiveButton, Source={StaticResource Strings}}"&gt; &lt;ribbon:RibbonButton.Style&gt; &lt;Style&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding ="{Binding ElementName=ItemsList, Path=SelectedItem.IsArchived}" Value="false"&gt; &lt;Setter Property="ribbon:RibbonButton.Command" Value="{Binding ArchiveItemCommand}" /&gt; &lt;Setter Property="ribbon:RibbonButton.LargeImageSource" Value="..\Assets\archive_insert.png" /&gt; &lt;Setter Property="ribbon:RibbonButton.Label" Value="{Binding Path=ItemArchiveButton, Source={StaticResource Strings}}" /&gt; &lt;/DataTrigger&gt; &lt;DataTrigger Binding ="{Binding ElementName=ItemsList, Path=SelectedItem.IsArchived}" Value="true"&gt; &lt;Setter Property="ribbon:RibbonButton.Command" Value="{Binding RestoreItemCommand}" /&gt; &lt;Setter Property="ribbon:RibbonButton.LargeImageSource" Value="..\Assets\archive_extract.png" /&gt; &lt;Setter Property="ribbon:RibbonButton.Label" Value="{Binding Path=ItemRestoreButton, Source={StaticResource Strings}}" /&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/ribbon:RibbonButton.Style&gt; &lt;/ribbon:RibbonButton&gt; </code></pre> <p>Setting the Command works fine in the both conditions, but not the other 2 properties...</p> <p>Any advice will be welcome.</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. 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