public FileIOMessage(Window owner, string title, string message, MessageBoxButton buttons, MessageType type) { InitializeComponent(); Owner = owner; Title = title; msg.Text = message; switch (buttons) { case MessageBoxButton.OK: AddButton("_OK", true, false); break; case MessageBoxButton.OKCancel: AddButton("_OK", true, false); AddButton("_Cancel", false, true); break; case MessageBoxButton.YesNo: AddButton("_Yes", true, false); AddButton("_No", false, true); break; case MessageBoxButton.YesNoCancel: AddButton("_Yes", true, false); AddButton("_No", false, false); AddButton("_Cancel", false, true); break; } Loaded += (sender, e) => { DialogHelpers.PlaySound(type); }; }