Exemplo n.º 1
0
        public CricularLineProgressAdorner(UIElement adornedElement, CricularLineProgress clp)
            : base(adornedElement)
        {
            _adornedElement       = adornedElement;
            _clp                  = clp;
            _clp.IsHitTestVisible = false;
            AddLogicalChild(clp);
            AddVisualChild(clp);
            _win = Window.GetWindow(adornedElement);
            _win.PreviewMouseMove += new MouseEventHandler(_win_PreviewMouseMove);
            var p = Mouse.GetPosition(_win);

            _clp.RenderTransform = new TranslateTransform(p.X, p.Y);

            DoubleAnimation anim  = new DoubleAnimation(50, 0, new Duration(TimeSpan.FromSeconds(Cryptool.PluginBase.Properties.Settings.Default.WorkspaceManager_BlingDelay)));
            DoubleAnimation anim2 = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(Cryptool.PluginBase.Properties.Settings.Default.WorkspaceManager_BlingDelay)));
            Storyboard      sb    = new Storyboard();

            Storyboard.SetTarget(anim, _clp);
            Storyboard.SetTarget(anim2, _clp);
            Storyboard.SetTargetProperty(anim, new PropertyPath(CricularLineProgress.RadiusProperty));
            Storyboard.SetTargetProperty(anim2, new PropertyPath(CricularLineProgress.OpacityProperty));
            sb.Children.Add(anim);
            sb.Children.Add(anim2);
            sb.Begin();
        }
Exemplo n.º 2
0
        private static void OnRadiusChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CricularLineProgress c = (CricularLineProgress)d;

            c.InvalidateVisual();
        }