I ran into the same problem but found a solution, I thought it might still be useful to share it.
Apparently FadeInThemeAnimation
is a special kind of animation that does not work on opacity and visibility, as you think, but on the RenderTransform element. I managed to get it to work when you reset the element first with FadeOutThemeAnimation
.
But here is a workaround. In your XAML, add a storyboard to your image container Resources, for example:
<Grid> <Grid.Resources> <Storyboard x:Name="ImageFadeInStoryboard"> <DoubleAnimation From="0" To="1" Storyboard.TargetName="yourImage" Storyboard.TargetProperty="Opacity" Duration="0:0:0.6" /> </Storyboard> </Grid.Resources> <Image x:Name="yourImage" Source="{Binding ...}"/> ...
Then add a handler to the ImageOpened
event image:
<Image x:Name="yourImage" Source="{Binding ...}" ImageOpened="OnImageOpened"/>
And in encoding:
private void OnImageOpened(object sender, RoutedEventArgs e) { ImageFadeInStoryboard.Begin(); }
Hope that helps :)
source share