0
Answer

how to change the next GIF image in windows phone 7

Hi friends, I am doing snakes and ladder game in windows phone7, i need to change gif images according to dice fall when i click the button continuously , i have given dice image in gif format and i have button to generate the random dice, how to change the Gif image according to random dice pls tell me if any body known ,my code is

Dice_Rolling()

{

   randomdice = ra.Next(1, 6);

if (randomdice == 1)
        {     


            ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
            ImageSource = new Uri("Images/Gif/dice_anim_1.gif", UriKind.RelativeOrAbsolute);
            this.DataContext = this;

        }

 if (randomdice == 2)
        {     


            ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
            ImageSource = new Uri("Images/Gif/dice_anim_2.gif", UriKind.RelativeOrAbsolute);
            this.DataContext = this;

        }               

if (randomdice == 3)
        {     


            ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
            ImageSource = new Uri("Images/Gif/dice_anim_3.gif", UriKind.RelativeOrAbsolute);
            this.DataContext = this;

        }     

 } 
      public Uri ImageSource { get; set; }

  private void button1_Click(object sender, RoutedEventArgs e)
  {

    Dice_Rolling();

 }