WIP
This commit is contained in:
48
ServiceBus98/Windows/MessageBoxWindow.xaml.cs
Normal file
48
ServiceBus98/Windows/MessageBoxWindow.xaml.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Media;
|
||||
using System.Windows;
|
||||
|
||||
namespace ServiceBus95
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for About.xaml
|
||||
/// </summary>
|
||||
public partial class MessageBoxWindow : Window
|
||||
{
|
||||
public MessageBoxWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SoundPlayer player = new SoundPlayer("Resources/Chord.wav");
|
||||
player.Play();
|
||||
}
|
||||
|
||||
public MessageBoxResult MessageBoxResult { get; set; }
|
||||
|
||||
public static MessageBoxResult Show(Window owner, string messageBoxText, string caption)
|
||||
{
|
||||
MessageBoxWindow window = new MessageBoxWindow
|
||||
{
|
||||
Owner = owner,
|
||||
Title = caption,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner
|
||||
};
|
||||
|
||||
window.MessageBoxText.Text = messageBoxText;
|
||||
window.ShowDialog();
|
||||
|
||||
return window.MessageBoxResult;
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBoxResult = MessageBoxResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBoxResult = MessageBoxResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user