private void StartSousVide() { var profile = new BrewProfile(); profile.Steps.Add(new MashingStep { Temperature = Temperature, LengthMinutes = Minutes, } ); _logic = new BrewLogic(profile); _logic.Start(); Task.Run(async() => { int count = Minutes * 60; while (_logic.IsRunning) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TimeRemaining = new TimeSpan(0, 0, count--); CurrentTemperature = TemperatureController.Instance.Controller.Temperature.ToString(); }); await Task.Delay(1000); } }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { var profile = e.Parameter as BrewProfile; if (profile != null) { Logic = new BrewLogic(profile); StepsPanel.DataContext = Logic; InfoGrid.DataContext = Logic.Info; PieStep.DataContext = Logic.Info; Pie.DataContext = Logic.Info; if (profile.DelayedStart) { StartBrewing_Click(null, null); } } }