diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-03-03 12:07:44 -0500 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-03-03 12:07:44 -0500 |
| commit | cff5cd9503f60dcb77930fc12e2c46dc6944fffd (patch) | |
| tree | 955dd24f599616ed6d4daf759b8fbf0b9c1c6533 /MediaBrowser.ServerApplication/NewItemNotifier.cs | |
| parent | a8683132a77771bf764a20827ac9a8d73fea56da (diff) | |
| parent | 9a4f73b9c8e8dd92da2365ca3e9bb5dba131ca20 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.ServerApplication/NewItemNotifier.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/NewItemNotifier.cs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/MediaBrowser.ServerApplication/NewItemNotifier.cs b/MediaBrowser.ServerApplication/NewItemNotifier.cs index 782e04a4a..4864cef62 100644 --- a/MediaBrowser.ServerApplication/NewItemNotifier.cs +++ b/MediaBrowser.ServerApplication/NewItemNotifier.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Entities; +using System.Windows; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Logging; @@ -110,23 +111,29 @@ namespace MediaBrowser.ServerApplication // Show the notification if (newItems.Count == 1) { - var window = (MainWindow) App.Current.MainWindow; - - window.Dispatcher.InvokeAsync(() => window.MbTaskbarIcon.ShowCustomBalloon(new ItemUpdateNotification(_logger) + Application.Current.Dispatcher.InvokeAsync(() => { - DataContext = newItems[0] + var window = (MainWindow)Application.Current.MainWindow; + + window.Dispatcher.InvokeAsync(() => window.MbTaskbarIcon.ShowCustomBalloon(new ItemUpdateNotification(_logger) + { + DataContext = newItems[0] - }, PopupAnimation.Slide, 6000)); + }, PopupAnimation.Slide, 6000)); + }); } else if (newItems.Count > 1) { - var window = (MainWindow)App.Current.MainWindow; - - window.Dispatcher.InvokeAsync(() => window.MbTaskbarIcon.ShowCustomBalloon(new MultiItemUpdateNotification(_logger) + Application.Current.Dispatcher.InvokeAsync(() => { - DataContext = newItems + var window = (MainWindow)Application.Current.MainWindow; + + window.Dispatcher.InvokeAsync(() => window.MbTaskbarIcon.ShowCustomBalloon(new MultiItemUpdateNotification(_logger) + { + DataContext = newItems - }, PopupAnimation.Slide, 6000)); + }, PopupAnimation.Slide, 6000)); + }); } } |
