Пример #1
0
        protected override void CheckItems(System.Collections.IList newItems)
        {
            foreach (object newItem in newItems)
            {
                if (!(newItem is DocumentContent))
                {
                    throw new InvalidOperationException("FloatingDocumentPane can contain only DocumentContents!");
                }
            }

            if (Items.Count == 0 && FloatingWindow != null)
            {
                FloatingWindow.Close(true);
            }
        }
Пример #2
0
        public void EndDrag(Point point)
        {
            IDropSurface dropSufrace = null;

            foreach (var surface in Surfaces)
            {
                if (surface.SurfaceRectangle.Contains(point))
                {
                    if (surface.OnDrop(point))
                    {
                        dropSufrace = surface;
                        break;
                    }
                }
            }

            foreach (var surface in SurfacesWithDragOver)
            {
                if (surface != dropSufrace)
                {
                    surface.OnDragLeave(point);
                }
            }

            SurfacesWithDragOver.Clear();

            _wnd.OnEndDrag(); //notify floating window that drag operation is coming to end

            if (dropSufrace != null)
            {
                _wnd.Close();
            }
            else
            {
                _wnd.Visibility = Visibility.Visible;
                _wnd.Activate();
            }

            _wnd = null;

            IsDragging = false;
        }