mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-30 10:57:51 +08:00
fixed a bug of MessageBox
This commit is contained in:
parent
42f17c4626
commit
4872b8e25c
@ -23,12 +23,12 @@ namespace HandyControlDemo.UserControl
|
||||
{
|
||||
MessageBox.Show(new MessageBoxInfo
|
||||
{
|
||||
MessageBoxText = Properties.Langs.Lang.GrowlAsk,
|
||||
Message = Properties.Langs.Lang.GrowlAsk,
|
||||
Caption = Properties.Langs.Lang.Title,
|
||||
Button = MessageBoxButton.YesNo,
|
||||
IconBrushKey = ResourceToken.AccentBrush,
|
||||
IconKey = ResourceToken.AskGeometry,
|
||||
Style = ResourceHelper.GetResource<Style>("MessageBoxCustom")
|
||||
StyleKey = "MessageBoxCustom"
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ namespace HandyControl.Controls
|
||||
MessageBox messageBox = null;
|
||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
messageBox = CreateMessageBox(null, info.MessageBoxText, info.Caption, info.Button, MessageBoxImage.None, info.DefaultResult);
|
||||
messageBox = CreateMessageBox(null, info.Message, info.Caption, info.Button, MessageBoxImage.None, info.DefaultResult);
|
||||
SetButtonStatus(messageBox, info.Button);
|
||||
|
||||
if (!string.IsNullOrEmpty(info.IconKey))
|
||||
@ -277,9 +277,9 @@ namespace HandyControl.Controls
|
||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
||||
}
|
||||
|
||||
if (info.Style != null)
|
||||
if (info.StyleKey != null)
|
||||
{
|
||||
messageBox.Style = info.Style;
|
||||
messageBox.Style = ResourceHelper.GetResource<Style>(info.StyleKey);
|
||||
}
|
||||
SystemSounds.Asterisk.Play();
|
||||
messageBox.ShowDialog();
|
||||
|
@ -4,7 +4,7 @@ namespace HandyControl.Data
|
||||
{
|
||||
public class MessageBoxInfo
|
||||
{
|
||||
public string MessageBoxText { get; set; }
|
||||
public string Message { get; set; }
|
||||
|
||||
public string Caption { get; set; }
|
||||
|
||||
@ -16,6 +16,6 @@ namespace HandyControl.Data
|
||||
|
||||
public MessageBoxResult DefaultResult { get; set; } = MessageBoxResult.None;
|
||||
|
||||
public Style Style { get; set; }
|
||||
public string StyleKey { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user