public void StartDrag(FloatingWindow wnd, Point point, Point offset)
        {
            _pane  = wnd.HostedPane;
            Offset = offset;

            _wnd = wnd;

            if (Offset.X >= _wnd.Width)
            {
                Offset.X = _wnd.Width / 2;
            }


            _wnd.Left = point.X - Offset.X;
            _wnd.Top  = point.Y - Offset.Y;
            _wnd.Show();

            foreach (IDropSurface surface in Surfaces)
            {
                if (surface.SurfaceRectangle.Contains(point))
                {
                    SurfacesWithDragOver.Add(surface);
                    surface.OnDragEnter(point);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Create and show a dockable window hosting this pane
        /// </summary>
        public virtual void DockableWindow()
        {
            FloatingWindow wnd = new FloatingWindow(this);

            SetFloatingWindowSizeAndPosition(wnd);

            ChangeState(PaneState.DockableWindow);

            wnd.Owner = DockManager.ParentWindow;
            wnd.Show();
        }
Пример #3
0
        /// <summary>
        /// Create and show a floating window hosting this pane
        /// </summary>
        public virtual void FloatingWindow()
        {
            ChangeState(PaneState.FloatingWindow);

            FloatingWindow wnd = new FloatingWindow(this);
            SetFloatingWindowSizeAndPosition(wnd);

            wnd.Owner = DockManager.ParentWindow;
            wnd.Show();
        }
        /// <summary>
        /// TODO
        /// </summary>
        private void InitiateFloating()
        {
            if (ManagedView.ParentContent == null)
                return;

            FloatingWindow floatingWindow = new FloatingWindow(_mouseXForFloatingWindow, ManagedView.ParentContent as FrameworkElement)
            {
                Owner = Window.GetWindow(ManagedItem)
            };

            //store the view or it will get destroyed
            View floatingView = ManagedView;

            floatingView.DockManager.AddFunctionalChild(floatingWindow);
            floatingView.ViewGroup.Remove(floatingView);

            //Initialize the floating window content
            TabGroup floatingTabGroup = new TabGroup();
            floatingTabGroup.Add(floatingView);
            floatingWindow.Content = floatingTabGroup;

            floatingWindow.Show();
            //After the window has been fully initialized, start dragging, since it's just been popped out
            if (Mouse.LeftButton == MouseButtonState.Pressed)
                floatingWindow.DragMove();
        }
Пример #5
0
        public void StartDrag(FloatingWindow wnd, Point point, Point offset)
        {
            _pane = wnd.HostedPane;
            Offset = offset;

            _wnd = wnd;

            if (Offset.X >= _wnd.Width)
                Offset.X = _wnd.Width / 2;

            _wnd.Left = point.X - Offset.X;
            _wnd.Top = point.Y - Offset.Y;
            _wnd.Show();

            foreach (IDropSurface surface in Surfaces)
            {
                if (surface.SurfaceRectangle.Contains(point))
                {
                    SurfacesWithDragOver.Add(surface);
                    surface.OnDragEnter(point);
                }
            }
        }