Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@Anatoily Nikolaev - thanks for your help! Your pointer on the label fixed the issue I had with it and you were right about the image. I'll mark your response as the answer. It was the source that was the issue.</p> <p>My label is now defined as:</p> <pre><code> &lt;Label x:Name="lblRun" Content="Run" HorizontalAlignment="Right" Margin="0,88,35,0" VerticalAlignment="Top" FontSize="20"&gt; &lt;Label.Style&gt; &lt;Style TargetType="{x:Type Label}"&gt; &lt;Setter Property="Foreground" Value="#FF2EAADC"/&gt; &lt;Style.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter Property="Foreground" Value="#006d9e"/&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/Label.Style&gt; &lt;/Label&gt; </code></pre> <p>My image is now defined as:</p> <pre><code> &lt;Image&gt; &lt;Image.Style&gt; &lt;Style TargetType="{x:Type Image}"&gt; &lt;Setter Property="Source" Value="{StaticResource arrow2}"/&gt; &lt;Setter Property="Height" Value="40"/&gt; &lt;Setter Property="Width" Value="40"/&gt; &lt;Setter Property="VerticalAlignment" Value="Center"/&gt; &lt;Setter Property="Margin" Value="0,0,80,0"/&gt; &lt;Setter Property="HorizontalAlignment" Value="Right"/&gt; &lt;Style.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter Property="Source" Value="{StaticResource arrow1}"/&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/Image.Style&gt; &lt;/Image&gt; </code></pre> <p>And I have resources (set in the App.xaml file), set as this:</p> <pre><code>&lt;Application x:Class="demos.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"&gt; &lt;Application.Resources&gt; &lt;BitmapImage x:Key="arrow1" UriSource="arrow1.png" /&gt; &lt;BitmapImage x:Key="arrow2" UriSource="arrow2.png" /&gt; &lt;/Application.Resources&gt; &lt;/Application&gt; </code></pre>
 

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