static void ChangingFrameIndex(DependencyObject obj, DependencyPropertyChangedEventArgs ev) { GifImage ob = obj as GifImage; ob.Source = ob.gf.Frames[(int)ev.NewValue]; ob.InvalidateVisual(); }