-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomMessageBox.xaml.cs
46 lines (34 loc) · 1.07 KB
/
CustomMessageBox.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
using System.Windows;
namespace Google_Bookmarks_Manager_for_GPOs
{
public partial class CustomMessageBox : Window
{
#region Public Constructors
public CustomMessageBox(string message, string caption, MessageBoxButton buttons)
{
InitializeComponent();
Title = caption;
MessageTextBlock.Text = message;
if (buttons == MessageBoxButton.OK)
{
CancelButton.Visibility = Visibility.Collapsed;
}
}
#endregion Public Constructors
#region Public Properties
public MessageBoxResult Result { get; private set; }
#endregion Public Properties
#region Private Methods
private void CancelButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.Cancel;
Close();
}
private void OKButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.OK;
Close();
}
#endregion Private Methods
}
}