diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-03 12:03:30 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-03 12:03:30 -0500 |
| commit | 9a4f73b9c8e8dd92da2365ca3e9bb5dba131ca20 (patch) | |
| tree | 6fcd92392b20b618a91372aca3cb92abcb0d01d3 | |
| parent | e36467f651713f3211167f26557e1b63f5cf5d3f (diff) | |
fixed new item notifications
| -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)); + }); } } |
