I have a button to which an image loaded from a ResourceDictionary is associated. In XAML I load them like this:
<Button x:Name="selecao" Grid.Row="1" Grid.Column="2" Margin="10" Click="selecao_Click">
<Image x:Name="img" Source = "{StaticResource inverno}"/>
</Button>
In code-behind I change it like this:
private void mudarImagem(int i)
{
switch (currentImage)
{
case 0: img.Source = (BitmapImage)Application.Current.Resources["inverno"]; break;
case 1: img.Source = (BitmapImage)Application.Current.Resources["primavera"]; break;
case 2: img.Source = (BitmapImage)Application.Current.Resources["verao"]; break;
case 3: img.Source = (BitmapImage)Application.Current.Resources["outono"]; break;
}
}
Is it possible to apply a "slide" transition effect when moving from one image to another?