-
-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathUpdateDialog.xaml.cs
More file actions
46 lines (40 loc) · 1.25 KB
/
UpdateDialog.xaml.cs
File metadata and controls
46 lines (40 loc) · 1.25 KB
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
using System.Windows;
namespace BabySmash
{
public partial class UpdateDialog : Window
{
public enum UpdateDialogResult
{
Download,
RemindLater,
Skip
}
public UpdateDialogResult Result { get; private set; } = UpdateDialogResult.RemindLater;
public UpdateDialog(string version, string releaseNotes)
{
InitializeComponent();
VersionText.Text = $"Version {version} is ready to install";
ReleaseNotesText.Text = string.IsNullOrWhiteSpace(releaseNotes)
? "No release notes available."
: releaseNotes;
}
private void DownloadButton_Click(object sender, RoutedEventArgs e)
{
Result = UpdateDialogResult.Download;
DialogResult = true;
Close();
}
private void RemindLaterButton_Click(object sender, RoutedEventArgs e)
{
Result = UpdateDialogResult.RemindLater;
DialogResult = false;
Close();
}
private void SkipButton_Click(object sender, RoutedEventArgs e)
{
Result = UpdateDialogResult.Skip;
DialogResult = false;
Close();
}
}
}