/// <summary> /// Recalculates the difficulty of the map. /// </summary> private void RecalculateDifficulty() { Source?.Cancel(); Source = new CancellationTokenSource(); Task.Run(() => { try { TextDifficultyRatingNumber.ClearAnimations(); TextDifficultyRatingNumber.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, TextDifficultyRatingNumber.Alpha, 0, 300)); LoadingWheel.ClearAnimations(); LoadingWheel.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, LoadingWheel.Alpha, 1, 300)); var rating = Screen.WorkingMap.SolveDifficulty().OverallDifficulty; TextDifficultyRatingNumber.Text = $"{rating:0.00}"; TextDifficultyRatingNumber.Tint = ColorHelper.DifficultyToColor(rating); LoadingWheel.ClearAnimations(); LoadingWheel.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, LoadingWheel.Alpha, 0, 300)); TextDifficultyRatingNumber.ClearAnimations(); TextDifficultyRatingNumber.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, TextDifficultyRatingNumber.Alpha, 1, 300)); } catch (Exception) { } }, Source.Token); }
/// <summary> /// Animates the loading wheel. /// </summary> private void HandleLoadingWheelAnimations() { if (LoadingWheel.Animations.Count != 0) { return; } var rotation = MathHelper.ToDegrees(LoadingWheel.Rotation); LoadingWheel.ClearAnimations(); LoadingWheel.Animations.Add(new Animation(AnimationProperty.Rotation, Easing.Linear, rotation, rotation + 360, 1000)); }
protected void DisplayCompletedPage() { LoadingWheel.Focus(); LoadingTxt_Lbl.Focus(); Wait_Txt.Focus(); panel2.Visible = true; LoadingTxt_Lbl.Visible = true; LoadingWheel.Visible = true; Wait_Txt.Visible = true; Lock_icon.Visible = true; bunifuFlatButton1.Enabled = false; bunifuFlatButton2.Enabled = false; bunifuFlatButton1.Cursor = Cursors.No; bunifuFlatButton2.Cursor = Cursors.No; Loading_Timer.Start(); }
/// <summary> /// Called when the user is searching/finishes searching. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnIsSearchingValueChanged(object sender, BindableValueChangedEventArgs <bool> e) { ClearAnimations(); var val = e.Value ? 0.85f : 0; Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, val, 150)); LoadingWheel.ClearAnimations(); LoadingWheel.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, (e.Value ? 1 : 0), 150)); Icon.ClearAnimations(); Icon.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, e.Value ? 1 : 0, 150)); Header.ClearAnimations(); Header.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, e.Value ? 1 : 0, 150)); }
private void HideLoadingWheel() { LoadingWheel.StopAnimating(); LoadingWheel.Hidden = true; StreetNumberTextView.Hidden = !IsSelected; }
private void ShowLoadingWheel() { LoadingWheel.StartAnimating(); LoadingWheel.Hidden = false; StreetNumberTextView.Hidden = true; }