protected override void OnVisualParentChanged(DependencyObject oldParent) { base.OnVisualParentChanged(oldParent); if (oldParent != null) { ActiveConnector = null; } else { ActiveConnector = lastActiveConnector; } }
private static void OnActiveConnectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DataVisual b = (DataVisual)d; IPluginInformation newInfo = (IPluginInformation)e.NewValue; IPluginInformation oldInfo = (IPluginInformation)e.OldValue; b.lastActiveConnector = oldInfo; if (newInfo == null) { b.timer.Stop(); } else { newInfo.Update(); b.timer.Start(); } }