예제 #1
0
 protected override void OnVisualParentChanged(DependencyObject oldParent)
 {
     base.OnVisualParentChanged(oldParent);
     if (oldParent != null)
     {
         ActiveConnector = null;
     }
     else
     {
         ActiveConnector = lastActiveConnector;
     }
 }
예제 #2
0
        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();
            }
        }