Example #1
0
        //开关按钮
        private void btnSwitch_Click(object sender, RoutedEventArgs e)
        {
            if (WallVideosHelper.GetEmptyWallVideo() == -1)//已打开满,不允许打开
            {
                return;
            }

            Button btnSwitch = (Button)sender;

            switch (btnSwitch.Name)
            {
            case "On":
                //btnSwitch.Style = App.Current.Resources["btnOff"] as Style;                    //已上墙的视频不允许在此处关闭,要在已打开视频列表里关闭
                //btnSwitch.Name = "Off";
                break;

            case "Off":
                btnSwitch.Style = App.Current.Resources["btnOn"] as Style;
                WallVideosHelper.OpenVideoToWall(btnSwitch.Tag as Camera);
                btnSwitch.Name = "On";
                break;

            default:
                break;
            }
        }