Example #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();
            });
        }
Example #2
0
 public void StopPulseAnim()
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Circle.BeginAnimation(Shape.StrokeThicknessProperty, null);
     });
 }
Example #3
0
 public void StopRotateAnim()
 {
     MyApp.ExecuteOnUI(delegate()
     {
         CenterForm.BeginAnimation(RotateTransform.AngleProperty, null);
     });
 }
Example #4
0
 public void SetInnerBrush(Color clr)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Circle.Fill = new SolidColorBrush(clr);
     });
 }
Example #5
0
 public void SetTitle(string title)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         WindowTitler.Text = title;
     });
 }
Example #6
0
 public void ToggleBackButton(bool state)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Button_Back.Visibility = (state ? Visibility.Visible : Visibility.Hidden);
     });
 }
Example #7
0
 public void ToggleCloseButton(bool state)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Button_Close.IsEnabled = state;
     });
 }
Example #8
0
 public void SetStatus(string statusText)
 {
     MyApp.ExecuteOnUI(delegate()
     {
         Status.Text = statusText;
     });
 }
Example #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);
     });
 }
Example #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;
            });
        }