예제 #1
0
 public void MoveDivider(Tab tabSelect)
 {
     foreach (var tab in TabCollection)
     {
         if (Equals(tab, tabSelect))
         {
             ActualSelect      = tab;
             tab.Title.Opacity = 1;
             if (_oldSelection == null)
             {
                 dt.Stop();
                 Divider.BeginAnimation(Canvas.LeftProperty,
                                        new DoubleAnimation(0, Canvas.GetLeft(tab), TimeSpan.FromMilliseconds(150)));
                 Animations.AnimateWidth(Divider.ActualWidth, tab.ActualWidth, Divider, 0.15, 0, () => dt.Start());
             }
             else
             {
                 dt.Stop();
                 Divider.BeginAnimation(Canvas.LeftProperty,
                                        new DoubleAnimation(Canvas.GetLeft(_oldSelection), Canvas.GetLeft(tab),
                                                            TimeSpan.FromMilliseconds(150)));
                 Animations.AnimateWidth(Divider.ActualWidth, tab.ActualWidth, Divider, 0.15, 0, () => dt.Start());
             }
         }
     }
 }
예제 #2
0
 private void Dt_Tick(object sender, EventArgs e)
 {
     if (ActualSelect != null)
     {
         Divider.BeginAnimation(Canvas.LeftProperty,
                                new DoubleAnimation(Canvas.GetLeft(Divider), Canvas.GetLeft(ActualSelect),
                                                    TimeSpan.FromMilliseconds(1)));
         Animations.AnimateWidth(Divider.ActualWidth, ActualSelect.ActualWidth, Divider, 0, 0, null);
     }
 }