0
votes

I am using this to display a gif in my app:

<Image Height="30" Width="30" gif:ImageBehavior.AnimatedSource="pack://application:,,,/OffPo diagnostic tool;component/resources/c1.gif" Grid.Column="1" Margin="394,110,42,22" Grid.Row="1" />

And it throws me this error :

Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.

My resource path is okay, even it shows the image in design time but fails to compile... What's wrong ?

SEMI-FIX

I used the exact path as the source:

C:\Users\nabil\Documents\Visual Studio 2015\Projects\OffPo Diagnostic Tool\OffPo Diagnostic Tool\resources\c1.gif

This fixed the problem but what if I move my application? Then the problem would occur again. Any permanent fix?

THIS IS WHAT I FOUND WHEN I TRIED INNEREXCEPTION

enter image description here

1
Do we need to worry about the <xmlns:gif="http://wpfanimatedgif.codeplex.com"> part or is it only pseudo-code to define the source of gif:ImageBehavior? Same for the <Grid> and </grid>, I hope that's not your real code?grek40
yeah , it's kindda copied..anyway, how do i fix the error ?? plese read my edit and give me a solutionChristopher H.
Well, I may look at it again when the mentioned problems are fixed (otherwise the answer would be "can't reproduce", because for example </grid> with lower case G doesn't match <Grid> and giving a different error than yours) Also please describe how exactly is your image configured as resource?grek40
Okey now ?.....Christopher H.
What if you use a relative path like Source="resources/c1.gif" ?mm8

1 Answers

0
votes

Fixed it myself...Or should i say SO saved my day again ??

Source

All i had to do is, select the image from the Solution explorer>Properties>Build action>changed 'None' to 'Resources'