浏览代码

Add "Countdown" tutorial item

Daniel Chalmers 3 年之前
父节点
当前提交
1d803bcbb6
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 3 1
      DesktopClock/MainWindow.xaml
  2. 7 0
      DesktopClock/MainWindow.xaml.cs

+ 3 - 1
DesktopClock/MainWindow.xaml

@@ -93,8 +93,10 @@
 				</MenuItem.Resources>
 			</MenuItem>
 
-			<Separator />
+			<MenuItem Click="MenuItemCountdown_OnClick" Header="_Countdown to..." />
 
+			<Separator />
+			
 			<MenuItem Click="MenuItemSettings_OnClick" Header="_Settings..." />
 
 			<MenuItem Click="MenuItemCheckForUpdates_OnClick" Header="Check for _updates..." />

+ 7 - 0
DesktopClock/MainWindow.xaml.cs

@@ -50,6 +50,13 @@ public partial class MainWindow : Window
         CopyToClipboard();
     }
 
+    private void MenuItemCountdown_OnClick(object sender, RoutedEventArgs e)
+    {
+        MessageBox.Show(this, 
+            $"Go to settings, change the {nameof(Settings.Default.CountdownTo)} option, and restart.\n\n" +
+            $"Get the clock back by deleting everything between the quotes.");
+    }
+
     private void MenuItemSettings_OnClick(object sender, RoutedEventArgs e)
     {
         Settings.Default.Save();