예제 #1
0
        private void ItemDragStarted(object sender, DragablzDragStartedEventArgs e)
        {
            var sourceOfDragItemsControl = ItemsControl.ItemsControlFromItemContainer(e.DragablzItem) as DragablzItemsControl;
            if (sourceOfDragItemsControl == null) return;

            var sourceTab = TabablzControl.GetOwnerOfHeaderItems(sourceOfDragItemsControl);
            if (sourceTab == null) return;

            if (sourceOfDragItemsControl.Items.Count != 1
                || (sourceTab.InterTabController != null && !sourceTab.InterTabController.MoveWindowWithSolitaryTabs)
                || Layout.IsContainedWithinBranch(sourceOfDragItemsControl))
                return;

            IsBeingDraggedByTab = true;
        }
예제 #2
0
        private void ItemDragStarted(object sender, DragablzDragStartedEventArgs e)
        {
            if (!IsMyItem(e.DragablzItem)) return;

            //the thumb may steal the user selection, so we will try and apply it manually
            if (_dragablzItemsControl == null) return;

            e.DragablzItem.IsDropTargetFound = false;

            var sourceOfDragItemsControl = ItemsControlFromItemContainer(e.DragablzItem) as DragablzItemsControl;
            if (sourceOfDragItemsControl != null && Equals(sourceOfDragItemsControl, _dragablzItemsControl))
            {
                var itemsControlOffset = Mouse.GetPosition(_dragablzItemsControl);
                _tabHeaderDragStartInformation = new TabHeaderDragStartInformation(e.DragablzItem, itemsControlOffset.X,
                    itemsControlOffset.Y, e.DragStartedEventArgs.HorizontalOffset, e.DragStartedEventArgs.VerticalOffset);

                foreach (var otherItem in _dragablzItemsControl.Containers<DragablzItem>().Except(e.DragablzItem))
                    otherItem.IsSelected = false;
                e.DragablzItem.IsSelected = true;
                e.DragablzItem.PartitionAtDragStart = InterTabController != null ? InterTabController.Partition : null;
                var item = _dragablzItemsControl.ItemContainerGenerator.ItemFromContainer(e.DragablzItem);
                var tabItem = item as TabItem;
                if (tabItem != null)
                    tabItem.IsSelected = true;
                SelectedItem = item;

                if (ShouldDragWindow(sourceOfDragItemsControl))
                    IsDraggingWindow = true;
            }
        }
예제 #3
0
        private void ItemDragStarted(object sender, DragablzDragStartedEventArgs eventArgs)
        {            
            foreach (var dragableItem in DragablzItems()
                .Except(new[] { eventArgs.DragablzItem }))
            {
                dragableItem.IsSiblingDragging = true;
            }
            eventArgs.DragablzItem.IsDragging = true;

            if (ItemsOrganiser != null)
            {
                var bounds = new Size(ActualWidth, ActualHeight);
                ItemsOrganiser.OrganiseOnDragStarted(this, bounds,
                    DragablzItems().Except(new[] { eventArgs.DragablzItem }).ToList(),
                    eventArgs.DragablzItem);
            }

            eventArgs.Handled = true;

            Dispatcher.BeginInvoke(new Action(InvalidateMeasure), DispatcherPriority.Loaded);
        }
예제 #4
0
 protected void OnDragStarted(DragablzDragStartedEventArgs e)
 {
     RaiseEvent(e);
 }
예제 #5
0
 protected void OnDragStarted(DragablzDragStartedEventArgs e)
 {            
     RaiseEvent(e);
 }