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