I have the following ResourceDictionary:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:semaforo.imagens">
<BitmapImage x:Key="semaforoVerde" UriSource="green.png" />
<BitmapImage x:Key="semaforoAmarelo" UriSource="yellow.png" />
<BitmapImage x:Key="semaforoVermelho" UriSource="red.png" />
Whenever I want to change the color of the semaphore I proceed like this:
semaforo.Source = new BitmapImage(new Uri("pack://application:,,,/imagens/red.png"));
Instead of the Uri used above it is possible to use something simpler like x: Key="traffic light" or something like this?