public override async Task RunTaskAsync(CancellationToken cancelToken) { try { //First lets check if the temperature is what it should be //according to the mashing step IStep temperature = new TemperatureStep() { Temperature = Temperature }; await temperature.RunTaskAsync(cancelToken); if (!HasStarted) { await UIMessager.Instance.ShowMessageAndWaitForFeedback($"{Type}", "Requires user input to continue. Press \"OK\" to continue.", UIMessageButtons.OK, UIMessageType.Information); } base.RunTaskAsync(cancelToken); while (LengthMinutes > ElapsedSeconds / 60) { if (cancelToken.IsCancellationRequested) { cancelToken.ThrowIfCancellationRequested(); } await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { ProgressPercent = ((ElapsedSeconds * 60) / LengthMinutes) * 100; }); await Task.Delay(1000, cancelToken); } } catch (OperationCanceledException) { } await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Finished = true; }); }
public override async Task RunTaskAsync(CancellationToken cancelToken) { try { //First lets check if the temperature is what it should be //according to the boiling step IStep temperature = new TemperatureStep() { Temperature = Temperature }; await temperature.RunTaskAsync(cancelToken); base.RunTaskAsync(cancelToken); while (LengthMinutes > ElapsedSeconds / 60) { if (cancelToken.IsCancellationRequested) { cancelToken.ThrowIfCancellationRequested(); } await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { ProgressPercent = (int)((ElapsedSeconds * 60) / LengthMinutes) * 100; }); await Task.Delay(1000, cancelToken); } } catch (OperationCanceledException) { } await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Finished = true; }); }