private Window CreateVideoWindow(ContentControl videoBorder, VideoWindowViewModel vm)
        {
            Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
            double x = p.X;
            double y = p.Y;
            VideoWindow videoWnd = new VideoWindow(vm, true);
            videoWnd.OffsetX = x;
            videoWnd.OffsetY = y;
            videoWnd.ReplicatedControl = videoBorder;
            videoWnd.Top = Top + videoWnd.OffsetY;
            videoWnd.Left = Left + videoWnd.OffsetX;
            videoWnd.Owner = this;
            videoWnd.Show();
            return videoWnd;

            //Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
            //double x = p.X;
            //double y = p.Y;
            //return CreateWindowInSeparateThread<VideoWindowAction>(() =>
            //{
            //    return new VideoWindow(vm, true);
            //},
            //    x, y, false, true, videoBorder);
        }
예제 #2
0
        private Window CreateVideoWindow(ContentControl videoBorder,VideoWindowViewModel vm)
        {
            Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
            double x = p.X;
            double y = p.Y;
            YoYoStudio.Controls.CustomWindow.ChildWindow<VideoWindowAction> videoWnd = new VideoWindow(vm, true);
            //VideoWindow videoWnd = new VideoWindow(vm, true);
            videoWnd.SetParent<RoomWindowAction>(this, true);
            videoWnd.OffsetX = x;
            videoWnd.OffsetY = y;
            videoWnd.ReplicatedControl = videoBorder;
            videoWnd.Top = Top + videoWnd.OffsetY;
            videoWnd.Left = Left + videoWnd.OffsetX;
            
            videoWnd.Owner = this;
            videoWnd.Show();
            return videoWnd;

            //Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
            //double x = p.X;
            //double y = p.Y;
            //VideoWindow wnd = CreateWindowInSeparateThread<VideoWindowAction>(() =>
            //{
            //    return new VideoWindow(vm, true);
            //},
            //    x, y, false, true, videoBorder) as VideoWindow;

            //wnd.MouseLeftButtonUp += wnd_MouseLeftButtonUp;
            //return wnd;
        }