예제 #1
0
        private void LoadSessionControls()
        {
            ClearSessionControls();

            if (!IsEnabled)
            {
                return;
            }

            if (_SMTC is GlobalSystemMediaTransportControlsSessionManager SMTC)
            {
                var sessions = SMTC.GetSessions();

                foreach (var session in sessions)
                {
                    SessionsStackPanel.Children.Add(new SessionControl
                    {
                        SMTCSession = session,
                        Margin      = new Thickness(0, 2, 0, 0)
                    });
                }

                if (SessionsStackPanel.Children.Count > 0)
                {
                    (SessionsStackPanel.Children[0] as SessionControl).Margin = new Thickness(0);
                    SecondaryContentVisible = true;
                }
            }
        }
예제 #2
0
        private void LoadSessionControls()
        {
            ClearSessionControls();

            if (!IsEnabled)
            {
                return;
            }

            if (_SMTC is GlobalSystemMediaTransportControlsSessionManager SMTC)
            {
                var sessions = SMTC.GetSessions();

                foreach (var session in sessions)
                {
                    sessionsPanel.SessionsStackPanel.Children.Add(new SessionControl
                    {
                        SMTCSession = session
                    });
                }

                if (sessionsPanel.SessionsStackPanel.Children.Count > 0)
                {
                    SecondaryContentVisible = true;
                    _SMTCAvail = true;
                }
            }
        }