コード例 #1
0
        public Scenario3_ChooseControl()
        {
            this.InitializeComponent();

            UserControl mediaControl;

            // If the MediaPlayerElement class is available, then create a user control that uses it.
            // Otherwise, create a user control that uses the older MediaElement control.
            if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Controls.MediaPlayerElement"))
            {
                mediaControl = new MPEUserControl();
            }
            else
            {
                mediaControl = new MEUserControl();
            }

            // Insert the control into our page.
            MediaPlayerPlacement.Children.Add(mediaControl);
        }
        public Scenario3_ChooseControl()
        {
            this.InitializeComponent();

            UserControl mediaControl;

            // If the MediaPlayerElement class is available, then create a user control that uses it.
            // Otherwise, create a user control that uses the older MediaElement control.
            if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Controls.MediaPlayerElement"))
            {
                mediaControl = new MPEUserControl();
            }
            else
            {
                mediaControl = new MEUserControl();
            }

            // Insert the control into our page.
            MediaPlayerPlacement.Children.Add(mediaControl);
        }