From fee03bf502700cb65c3b67742df6cee5ca45a2e5 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sat, 2 Jul 2022 00:30:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=A8=E5=A4=A9?= =?UTF-8?q?=E5=90=8E=E2=80=9C=E6=AF=8F=E6=97=A5=E5=85=B3=E5=8D=A1=E5=B0=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E2=80=9D=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/TaskQueueViewModel.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs index 2ef4abbc9c..307eba4d6a 100644 --- a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs +++ b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs @@ -97,13 +97,14 @@ namespace MeoAsstGui private void Timer1_Elapsed(object sender, EventArgs e) { + UpdateDatePrompt(); + int intMinute = DateTime.Now.Minute; if (intMinute != 0 || Idle == false) { return; } - UpdateDatePrompt(); int intHour = DateTime.Now.Hour; var settings = _container.Get(); @@ -195,7 +196,6 @@ namespace MeoAsstGui }; InitDrops(); - UpdateDatePrompt(); } @@ -219,18 +219,28 @@ namespace MeoAsstGui { "周日了,记得打剿灭哦~", new List { DayOfWeek.Sunday } } }; - StagesOfToday = "今日关卡小提示:\n"; + var prompt = "今日关卡小提示:\n"; foreach (var item in stage_dict) { if (item.Value.Contains(now.DayOfWeek)) { - StagesOfToday += item.Key + "\n"; + prompt += item.Key + "\n"; } } + if (StagesOfToday != prompt) + { + StagesOfToday = prompt; + } } - public string StagesOfToday { get; set; } + private string _stagesOfToday = ""; + + public string StagesOfToday + { + get { return _stagesOfToday; } + set { SetAndNotify(ref _stagesOfToday, value); } + } public void AddLog(string content, string color = "Gray", string weight = "Regular") {