地图与window的点击事件产生冲突

0 投票

当我点击关闭window弹窗,弹窗关闭后,下面的地图也会有一定的移动,我判断一样时点击事件冲突了,这个应该怎么解决啊?

11月 19, 2020 分类:  81次浏览 | 用户: yangL 才疏学浅 (12 分)

1个回答

0 投票
你检查一下你的代码,事件在实现完成后有注销掉吗
11月 19, 2020 用户: 程逸诗 名扬四海 (4,248 分)
//本地视频
            try
            {

                Selection3D[] selections = mSceneControl.Scene.FindSelection(true);
                Recordset record = selections[0].ToRecordset();

                if (record.Dataset != video_dsv)
                    return;
                string videoId = record.GetFieldValue("Videoid").ToString();

                string[] index = { "IP监控点3_muli", "IP监控点4_muli", "IP监控点9_muli", "IP监控点10_muli", "IP监控点14_muli", "IP监控点22_muli", "IP监控点23_muli", "IP监控点24_muli", "IP监控点25_muli" };

                int indexindex = 0;
                for(int i = 0;i<index.Length;i++)
                {
                    if(videoId.Equals(index[i]))
                    {
                        indexindex = i;
                    }
                }

                Window window = new Window();
                window.Width = 800;
                window.Height = 600;

                // 控制弹出位置在屏幕正中
                double screenHeight = SystemParameters.FullPrimaryScreenHeight;
                double screenWidth = SystemParameters.FullPrimaryScreenWidth;
                window.Top = (screenHeight - window.Height) / 2;
                window.Left = (screenWidth - window.Width) / 2;

                MediaElement player = new MediaElement();
                //player.Margin = new Thickness(1, 1, 1, 1);
                player.Width = 800;
                player.Height = 600;

                // 视频资源放在Debug\bin目录下
                var mp4_path = AppDomain.CurrentDomain.BaseDirectory + @"video\video"+indexindex+".mp4";
                player.Source = new Uri(mp4_path, UriKind.RelativeOrAbsolute);
                player.LoadedBehavior = MediaState.Manual;
                player.Stop();
                player.Play();

             
                // 视频播放控件加入到窗体中
                window.Content = player;
                window.ShowDialog();

            }
            catch
            {

            }

这是我的代码,需要在那里添加注销事件啊?
你事件是在哪里注册的
...