public override async void Execute() { RTAnimationCurve rtAnimationCurve = CurveService.GetAnimationCurve(); rtAnimationCurve.ShowCurveEditor(); rtAnimationCurve.NewWindow(); AnimationCurve animationCurve = BrushService.GetBrushWidthCurve(); rtAnimationCurve.Add(ref animationCurve); rtAnimationCurve.SetGradXRange(0, 1f); rtAnimationCurve.SetGradYRange(0, 0.5f); await TaskEx.WaitWhile(CurveService.IsEditorOpen); BrushService.SetBrushWidthCurve(animationCurve); }
/// <summary>Shows the view and wait while it will be closed</summary> public static async Task ShowAsync(BaseView view, BaseView owner, Action onAnimationDone = null, bool noAnimation = false, bool closeChildrenIfOpened = false) { Show(view, owner, onAnimationDone, noAnimation, closeChildrenIfOpened); await TaskEx.WaitWhile(() => view.VisibleState != VisibleState.Closed); }
public override async void Execute() { RTAnimationCurve rtAnimationCurve = CurveService.GetAnimationCurve(); rtAnimationCurve.ShowCurveEditor(); rtAnimationCurve.NewWindow(); AnimationCurve animationCurve = AnimationCurve.Constant(0, 1, 0.5f); switch (CurveType) { case CurveType.Animation: animationCurve = LineModel.KochLineProperty.AnimationCurve; break; case CurveType.Width: animationCurve = LineModel.WidthCurve; break; case CurveType.Lerp: animationCurve = LineModel.PhyllotaxisProperty.LerpInterpolationCurve; break; case CurveType.Scale: animationCurve = LineModel.PhyllotaxisProperty.ScaleInterpolationCurve; break; default: throw new ArgumentOutOfRangeException(); } rtAnimationCurve.Add(ref animationCurve); switch (CurveType) { case CurveType.Animation: case CurveType.Lerp: case CurveType.Scale: rtAnimationCurve.SetGradYRange(0, 1); break; case CurveType.Width: rtAnimationCurve.SetGradYRange(0, 0.5f); break; default: throw new ArgumentOutOfRangeException(); } rtAnimationCurve.SetGradXRange(0, 1); await TaskEx.WaitWhile(CurveService.IsEditorOpen); switch (CurveType) { case CurveType.Animation: LineModel.KochLineProperty.AnimationCurve = animationCurve; break; case CurveType.Width: LineModel.WidthCurve = animationCurve; break; case CurveType.Lerp: LineModel.PhyllotaxisProperty.LerpInterpolationCurve = animationCurve; break; case CurveType.Scale: LineModel.PhyllotaxisProperty.ScaleInterpolationCurve = animationCurve; break; default: throw new ArgumentOutOfRangeException(); } UpdateLineSignal.Dispatch(LineModel); }