views:

536

answers:

3

I would like to display an animation gif such as loading... in my XAML as my procedure is progressing. I found out that this cannot be easily done in WPF as I loaded my Gif and it just shows the first frame. What are the best ways to display an animation in WPF.

A: 

here is a similar question

Natrium
A: 

And here too an answer.

luvieere
A: 

You could embed a MediaElement

<MediaElement LoadedBehavior="Play" Source="path/to.file" />

or winforms PictureBox:

    <wfi:WindowsFormsHost>
        <winForms:PictureBox x:Name="pictureBoxLoading">
        </winForms:PictureBox>
    </wfi:WindowsFormsHost>

However, I'd recommend finding a way to do this in WPF. Have a look at StoryBoards and animations. Without knowing what you're trying to achieve or why you want to do this it's hard to advise further.

Matt Lacey