Skip to content

Commit 52cd8a8

Browse files
committed
Adjust Clock Code
1 parent cd79a2a commit 52cd8a8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Flow.Launcher.Plugin.SharedCommands;
2323
using System.Windows.Threading;
2424
using System.Globalization;
25+
using System.Reflection.Emit;
2526

2627
namespace Flow.Launcher
2728
{
@@ -47,11 +48,15 @@ public MainWindow(Settings settings, MainViewModel mainVM)
4748
_settings = settings;
4849

4950

50-
DispatcherTimer timer = new DispatcherTimer();
51-
timer.Interval = new TimeSpan(0, 0, 1);
52-
timer.Tick += Timer_Tick;
51+
var timer = new Timer
52+
{
53+
Interval = 1000,
54+
};
55+
timer.Tick += (s, evt) =>
56+
{
57+
ClockDisplay();
58+
};
5359
timer.Start();
54-
5560
InitializeComponent();
5661
InitializePosition();
5762
animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
@@ -61,10 +66,6 @@ public MainWindow()
6166
{
6267
InitializeComponent();
6368
}
64-
private void Timer_Tick(object sender, EventArgs e)
65-
{
66-
ClockDisplay();
67-
}
6869

6970
public void ClockDisplay()
7071
{

0 commit comments

Comments
 (0)