user3753693
user3753693

Reputation: 245

Xaml Storyboard Animation not firing

I am trying to fix a UI that had an animation previously. It had a Picture that rendered on the interface when the app is loaded. I am having a tough time trying to get over the learning curve of XAML. Also if someone has a resource where I can better learn XAML I would really appreciate it. The issues is nothing shows the image does not render on start and there is not animation as far as I can tell.

<Image x:Name="T_Image" 
       HorizontalAlignment="Left" 
       Height="300" 
       VerticalAlignment="Top" 
       Width="300" 
       Source="Resources/Picture.png" 
       OpacityMask="Black" 
       Panel.ZIndex="1">
    <Image.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="T_Image"
                                     Storyboard.TargetProperty="Height"
                                     From="300" To="85" Duration="00:00:00.75" />
                    <DoubleAnimation Storyboard.TargetName="T_Image"
                                     Storyboard.TargetProperty="Width"
                                     From="300" To="105" Duration="00:00:0.75" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Image.Triggers>
</Image>

Upvotes: 0

Views: 308

Answers (2)

user3753693
user3753693

Reputation: 245

Fixed it using my original and code, Deleting the OpacityMask Panel Z index and changing to a static path fixed the issue now i just have to find a way to make the path dynamic to any machine its ran on

Upvotes: 0

Kcvin
Kcvin

Reputation: 5163

If the image does not get rendered at all, it is likely that the Image.Source URI is incorrect. Read up on using the proper Pack URIs and it may solve your problem.

Here is an answer I gave previously that worked just fine. The image resource was located in the same project as the XAML and is under an assests/images folder.

Upvotes: 1

Related Questions