internal async Task PlayLoadFailedAnimationAsync() { EnsureVisible(); _dragNDropHintState = DragNDropHintState.Failed; await PlaySegmentAsync(FailLoading); _dragNDropHintState = DragNDropHintState.Initial; _dragNDropHint.SetProgress(FailLoading.ToProgress); }
internal void PlayDragLeaveAnimation() { EnsureVisible(); if (_dragNDropHintState == DragNDropHintState.Encouraging) { _dragNDropHintState = DragNDropHintState.Shrinking; #pragma warning disable VSTHRD110 // Observe result of async calls PlaySegmentAsync(ShrinkToInitial); #pragma warning restore VSTHRD110 // Observe result of async calls } }
// Avoid "async void" method. Not valid here because we handle all async exceptions. #pragma warning disable VSTHRD100 internal async void PlayDragEnterAnimation() { #pragma warning restore VSTHRD100 EnsureVisible(); if (_dragNDropHintState == DragNDropHintState.Initial || _dragNDropHintState == DragNDropHintState.Shrinking) { _dragNDropHintState = DragNDropHintState.Encouraging; try { await PlaySegmentAsync(ExpandFromInitial); await PlaySegmentAsync(ExcitedDropLoop); } catch { // Ignore async exceptions so they won't crash the process. } } }
internal void PlayInitialStateAnimation() { switch (_dragNDropHintState) { case DragNDropHintState.Failed: case DragNDropHintState.Finished: case DragNDropHintState.Initial: break; case DragNDropHintState.Disabled: case DragNDropHintState.Encouraging: case DragNDropHintState.Shrinking: default: return; } EnsureVisible(); _dragNDropHintState = DragNDropHintState.Initial; _dragNDropHint.SetProgress(0.007); }
internal async Task PlayDroppedAnimationAsync() { EnsureVisible(); if (_dragNDropHintState == DragNDropHintState.Encouraging) { await PlaySegmentAsync(ExcitedResolution); if (_dragNDropHintState != DragNDropHintState.Encouraging) { return; } } _dragNDropHintState = DragNDropHintState.Finished; // Fade out. This is only necessary for RS4 builds that // do not handle 0-size strokes correctly, leaving crud on // the screen. _fadeOutStoryboard.Begin(); await PlaySegmentAsync(FinishLoading); }