private static void GifSourcePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { try { AVGifPlayer gifPlayer = sender as AVGifPlayer; gifPlayer.InitializeGif(); } catch { } }
private static void FrameIndexPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs ev) { try { AVGifPlayer gifPlayer = sender as AVGifPlayer; gifPlayer.Source = gifPlayer.vGifDecoder.Frames[(int)ev.NewValue]; } catch { } }
private static void AutoStartPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { try { if ((bool)e.NewValue) { AVGifPlayer gifPlayer = sender as AVGifPlayer; gifPlayer.StartAnimation(); } } catch { } }
private static void SpeedRatioPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { try { AVGifPlayer gifPlayer = sender as AVGifPlayer; if (gifPlayer.vInt32Animation != null) { gifPlayer.vInt32Animation.SpeedRatio = (double)e.NewValue; if (gifPlayer.vAnimating) { gifPlayer.StopAnimation(); gifPlayer.StartAnimation(); } } } catch { } }