-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml.cs
50 lines (42 loc) · 1.21 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace FloatingClock
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Handle_LeftButtonDown(Object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void Handle_RightButtonDown(Object sender, MouseButtonEventArgs e)
{
ContextMenu.IsOpen = true;
}
private void Handle_About(Object sender, RoutedEventArgs e) {
var about = new AboutBox();
about.ShowDialog();
}
private void Handle_Exit(object sender, RoutedEventArgs e)
{
Close();
}
private void Handle_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
(FindName("Clock") as Clock).Stop();
Properties.Settings.Default.Save();
}
private void Handle_ContentRendered(object sender, EventArgs e)
{
(FindName("Clock") as Clock).Start();
}
}
}