示例#1
0
        public void StartPulseAnim(int min = 5, int max = 10, double secPulse = 0.5)
        {
            MyApp.ExecuteOnUI(delegate()
            {
                TimeSpan pulseTime = TimeSpan.FromSeconds(secPulse);

                Storyboard sb = new Storyboard()
                {
                    RepeatBehavior = RepeatBehavior.Forever
                };

                var anim         = new DoubleAnimation(min, max, new Duration(pulseTime));
                var anim_reverse = new DoubleAnimation(max, min, new Duration(pulseTime))
                {
                    BeginTime = pulseTime
                };

                sb.Children.Add(anim);
                sb.Children.Add(anim_reverse);

                Storyboard.SetTarget(anim, Circle);
                Storyboard.SetTarget(anim_reverse, Circle);

                Storyboard.SetTargetProperty(anim, new PropertyPath(Shape.StrokeThicknessProperty));
                Storyboard.SetTargetProperty(anim_reverse, new PropertyPath(Shape.StrokeThicknessProperty));

                sb.Begin();
            });
        }
示例#2
0
 public void StopPulseAnim()
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Circle.BeginAnimation(Shape.StrokeThicknessProperty, null);
     });
 }
示例#3
0
 public void StopRotateAnim()
 {
     MyApp.ExecuteOnUI(delegate()
     {
         CenterForm.BeginAnimation(RotateTransform.AngleProperty, null);
     });
 }
示例#4
0
 public void SetInnerBrush(Color clr)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Circle.Fill = new SolidColorBrush(clr);
     });
 }
示例#5
0
 public void SetTitle(string title)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         WindowTitler.Text = title;
     });
 }
示例#6
0
 public void ToggleBackButton(bool state)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Button_Back.Visibility = (state ? Visibility.Visible : Visibility.Hidden);
     });
 }
示例#7
0
 public void ToggleCloseButton(bool state)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Button_Close.IsEnabled = state;
     });
 }
示例#8
0
 public void SetStatus(string statusText)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Status.Text = statusText;
     });
 }
示例#9
0
 public void StartRotateAnim(double secRotateTime = 0.75)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         var anim            = new DoubleAnimation(0, 360, new Duration(TimeSpan.FromSeconds(secRotateTime)));
         anim.RepeatBehavior = RepeatBehavior.Forever;
         CenterForm.BeginAnimation(RotateTransform.AngleProperty, anim);
     });
 }
示例#10
0
        public void FillUp(int percentage)
        {
            MyApp.ExecuteOnUI(delegate()
            {
                if (!(percentage <= 100 && percentage >= 0))
                {
                    return;
                }

                var heightOfPercent = ActualHeight / 100;
                percentage          = 100 - percentage; //Reverse
                Filler.Height       = heightOfPercent * percentage;
            });
        }