Growl can now be used in threads
This commit is contained in:
1 parent
36008d83e2
commit
b8692d080f
2 files changed
+36
-30
No files matched your search
@@ -261,22 +261,25 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
private static void Show(GrowlInfo growlInfo)
|
private static void Show(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
var ctl = new Growl
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
Message = growlInfo.Message,
|
var ctl = new Growl
|
||||||
Time = DateTime.Now,
|
{
|
||||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
Message = growlInfo.Message,
|
||||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
Time = DateTime.Now,
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
ShowDateTime = growlInfo.ShowDateTime,
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
ConfirmStr = growlInfo.ConfirmStr,
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
CancelStr = growlInfo.CancelStr,
|
ShowDateTime = growlInfo.ShowDateTime,
|
||||||
Type = growlInfo.Type,
|
ConfirmStr = growlInfo.ConfirmStr,
|
||||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
CancelStr = growlInfo.CancelStr,
|
||||||
};
|
Type = growlInfo.Type,
|
||||||
GrowlPanel.Children.Insert(0, ctl);
|
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||||
|
};
|
||||||
|
GrowlPanel.Children.Insert(0, ctl);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -261,22 +261,25 @@ namespace HandyControl.Controls
|
|||||||
/// <param name="growlInfo"></param>
|
/// <param name="growlInfo"></param>
|
||||||
private static void Show(GrowlInfo growlInfo)
|
private static void Show(GrowlInfo growlInfo)
|
||||||
{
|
{
|
||||||
var ctl = new Growl
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
Message = growlInfo.Message,
|
var ctl = new Growl
|
||||||
Time = DateTime.Now,
|
{
|
||||||
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
Message = growlInfo.Message,
|
||||||
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
Time = DateTime.Now,
|
||||||
_showCloseButton = growlInfo.ShowCloseButton,
|
Icon = ResourceHelper.GetResource<Geometry>(growlInfo.IconKey),
|
||||||
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
IconBrush = ResourceHelper.GetResource<Brush>(growlInfo.IconBrushKey),
|
||||||
_staysOpen = growlInfo.StaysOpen,
|
_showCloseButton = growlInfo.ShowCloseButton,
|
||||||
ShowDateTime = growlInfo.ShowDateTime,
|
ActionBeforeClose = growlInfo.ActionBeforeClose,
|
||||||
ConfirmStr = growlInfo.ConfirmStr,
|
_staysOpen = growlInfo.StaysOpen,
|
||||||
CancelStr = growlInfo.CancelStr,
|
ShowDateTime = growlInfo.ShowDateTime,
|
||||||
Type = growlInfo.Type,
|
ConfirmStr = growlInfo.ConfirmStr,
|
||||||
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
CancelStr = growlInfo.CancelStr,
|
||||||
};
|
Type = growlInfo.Type,
|
||||||
GrowlPanel.Children.Insert(0, ctl);
|
_waitTime = Math.Max(growlInfo.WaitTime, 2)
|
||||||
|
};
|
||||||
|
GrowlPanel.Children.Insert(0, ctl);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in new issue
Block a user