private static void SpriteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var instance = d as SpriteItemControl; if (instance != null) instance.DataContext = e.NewValue; }