From 8b1de950a288cd94954aba60685cfa8912f879a5 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Fri, 24 Apr 2020 17:16:20 +0300 Subject: [PATCH] auto change current work time left --- PomoTime/MainPage.xaml.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PomoTime/MainPage.xaml.cs b/PomoTime/MainPage.xaml.cs index 27b6600..43861a6 100644 --- a/PomoTime/MainPage.xaml.cs +++ b/PomoTime/MainPage.xaml.cs @@ -35,9 +35,20 @@ namespace PomoTime private const int DefaultWorkMinutes = 25; private const int DefaultLongBreakMinutes = 15; - + private int _work_minutes; private int BreakMinutes { get; set; } - private int WorkMinutes { get; set; } + private int WorkMinutes + { + get { return _work_minutes; } + set + { + if (!runningState.IsRunning && runningState.CurrentPeriod == Period.Work) + { + runningState.MinutesLeft = value; + } + _work_minutes = value; + } + } private int LongBreakMinutes { get; set; }