private static void OnInputSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VertexManipulator instance = (VertexManipulator)d; UIElement oldInputSource = e.OldValue as UIElement; UIElement newInputSource = e.NewValue as UIElement; if (oldInputSource != null) { instance.UnregisterInputSource(oldInputSource); } if (newInputSource != null) { instance.RegisterInputSource(); } }
private static void OnSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { VertexManipulator instance = (VertexManipulator)obj; DynamicMesh newMesh = (DynamicMesh)args.NewValue; DynamicMesh oldMesh = (DynamicMesh)args.OldValue; if (oldMesh != null) { instance.UnregisterSource(oldMesh); } if (newMesh != null) { instance.RegisterSource(); } }