Beispiel #1
0
        private void ShowTrackNotification(Audio track)
        {
            if (track == null)
                return;

            var w = CurrentUIMode == UIMode.Normal
                ? Application.Current.MainWindow
                : Application.Current.Windows.OfType<CompactView>().FirstOrDefault();

            if (w == null)
                return;

            if (w.IsActive &&
                w.WindowState != WindowState.Minimized)
                return;

            var notificationView = Application.Current.Windows.OfType<TrackNotifcationView>().FirstOrDefault();
            if (notificationView == null)
            {
                notificationView = new TrackNotifcationView(track);
                notificationView.Show();
            }
            else
            {
                notificationView.Track = track;
            }
        }
Beispiel #2
0
        private void ShowTrackNotification(Audio track)
        {
            if (track == null)
                return;

            Window w;

            if (CurrentUIMode == UIMode.Normal)
                w = Application.Current.MainWindow;
            else
            {
                var t = CurrentUIMode == UIMode.CompactLandscape ? typeof(CompactLandscapeView) : typeof(CompactView);
                w = CurrentUIMode == UIMode.CompactLandscape
                    ? (Window)Application.Current.Windows.OfType<CompactLandscapeView>().FirstOrDefault()
                    : (Window)Application.Current.Windows.OfType<CompactView>().FirstOrDefault();
            }

            if (w == null)
                return;

            if (w.IsActive &&
                w.WindowState != WindowState.Minimized)
                return;

            var notificationView = Application.Current.Windows.OfType<TrackNotifcationView>().FirstOrDefault();
            if (notificationView == null)
            {
                notificationView = new TrackNotifcationView(track);
                notificationView.Show();
            }
            else
            {
                notificationView.Track = track;
            }
        }