public ClassPlayerView(Grid Main)
        {
            InitializeComponent();
            mainWindow = Main;
            cdb        = new DBPlugin.CourseDB();
            double left = this.Margin.Left - 80;

            this.Margin = new Thickness(left, 20, 0, 0);
            this.CourseListGrid.Visibility = System.Windows.Visibility.Visible;

            tmrProgress = new DispatcherTimer();
            //设置计时器的时间间隔为1秒
            tmrProgress.Interval = new TimeSpan(0, 0, 1);
            //计时器触发事件处理
            tmrProgress.Tick += SetDisplayMessage;
            SetImageForMediaElement();

            ctv = new ClassTopView();
            ctv.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
            ctv.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            ctv.Margin = new Thickness(24, 5, 0, 0);
            ctv.clasTopImage.Source       = new BitmapImage(new Uri("/PmtsControlLibrary;component/Image/classTopImage.png", UriKind.Relative));
            ctv.RelaxNameText.Visibility  = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText1.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText2.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText3.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText4.Visibility = System.Windows.Visibility.Hidden;
            if (!this.mainWindow.Children.Contains(ctv))
            {
                this.mainWindow.Children.Add(ctv);
            }
            courseTreeView = new TreeView();

            initFullScreenVideo();
        }
Example #2
0
        public RecordPlayerView(Grid Main)
        {
            InitializeComponent();
            mainWindow = Main;
            cdb        = new DBPlugin.CourseDB();
            double left = this.Margin.Left - 80;

            this.Margin = new Thickness(left, 20, 0, 0);
            this.CourseListGrid.Visibility = System.Windows.Visibility.Visible;
            tmrProgress = new DispatcherTimer();
            //设置计时器的时间间隔为1秒
            tmrProgress.Interval = new TimeSpan(0, 0, 1);
            //计时器触发事件处理
            tmrProgress.Tick += SetDisplayMessage;
            SetImageForMediaElement();

            ctv = new ClassTopView();
            ctv.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
            ctv.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            ctv.Margin = new Thickness(24, 5, 0, 0);

            ctv.clasTopImage.Source       = new BitmapImage(new Uri("/PmtsControlLibrary;component/Image/relaxTopImage.png", UriKind.Relative));
            ctv.RelaxNameText.Visibility  = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText1.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText2.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText3.Visibility = System.Windows.Visibility.Hidden;
            ctv.RelaxNameText4.Visibility = System.Windows.Visibility.Hidden;
            if (!this.mainWindow.Children.Contains(ctv))
            {
                this.mainWindow.Children.Add(ctv);
            }
            courseTreeView = new TreeView();
            MusicPlayer    = new MediaPlayer();
            //button声音
            Grid uiButton = this.Content as Grid;
            UIElementCollection Childrens = uiButton.Children;

            foreach (UIElement ui in Childrens)
            {
                //ui转成控件
                if (ui is System.Windows.Controls.Button)
                {
                    ui.MouseEnter += new MouseEventHandler(ui_MouseEnter);
                }
            }
            initFullScreenVideo();
        }