Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Dragablz/Dockablz/Layout.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.CodeDom;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -193,12 +192,26 @@ public static BranchResult Branch(TabablzControl tabablzControl, TabablzControl
return branchResult;
}

// Add parition as dependency property
public static readonly DependencyProperty PartitionProperty = DependencyProperty.Register(
"Partition", typeof (object), typeof (Layout), new PropertyMetadata(default(object)));

/// <summary>
/// Use in conjuction with the <see cref="InterTabController.Partition"/> on a <see cref="TabablzControl"/>
/// to isolate drag and drop spaces/control instances.
/// </summary>
public string Partition { get; set; }
public object Partition
{
get { return (object) GetValue(PartitionProperty); }
set { SetValue(PartitionProperty, value); }
}

/// <summary>
/// Use in conjuction with the <see cref="InterTabController.Partition"/> on a <see cref="TabablzControl"/>
/// to isolate drag and drop spaces/control instances.
/// </summary>
//public string Partition { get; set; }

public static readonly DependencyProperty InterLayoutClientProperty = DependencyProperty.Register(
"InterLayoutClient", typeof (IInterLayoutClient), typeof (Layout), new PropertyMetadata(new DefaultInterLayoutClient()));

Expand Down Expand Up @@ -450,7 +463,7 @@ private static void SetupParticipatingLayouts(DragablzItem dragablzItem)
if (draggingWindow == null) return;

foreach (var loadedLayout in LoadedLayouts.Where(l =>
l.Partition == dragablzItem.PartitionAtDragStart &&
l.Partition?.ToString() == dragablzItem.PartitionAtDragStart &&
!Equals(Window.GetWindow(l), draggingWindow)))

{
Expand Down
9 changes: 4 additions & 5 deletions Dragablz/InterTabController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Dynamic;
using System.Windows;
using System.Windows;

namespace Dragablz
{
Expand Down Expand Up @@ -48,8 +47,7 @@ public IInterTabClient InterTabClient
get { return (IInterTabClient) GetValue(InterTabClientProperty); }
set { SetValue(InterTabClientProperty, value); }
}

/*

public static readonly DependencyProperty PartitionProperty = DependencyProperty.Register(
"Partition", typeof (object), typeof (InterTabController), new PropertyMetadata(default(object)));

Expand All @@ -62,12 +60,13 @@ public object Partition
get { return (object) GetValue(PartitionProperty); }
set { SetValue(PartitionProperty, value); }
}
*/

/*
/// <summary>
/// The partition allows on or more tab environments in a single application. Only tabs which have a tab controller
/// with a common partition will be allowed to have tabs dragged between them. <c>null</c> is a valid partition (i.e global).
/// </summary>
public string Partition { get; set; }
*/
}
}
2 changes: 1 addition & 1 deletion Dragablz/TabablzControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ private void ItemDragStarted(object sender, DragablzDragStartedEventArgs e)
foreach (var otherItem in _dragablzItemsControl.Containers<DragablzItem>().Except(e.DragablzItem))
otherItem.IsSelected = false;
e.DragablzItem.IsSelected = true;
e.DragablzItem.PartitionAtDragStart = InterTabController?.Partition;
e.DragablzItem.PartitionAtDragStart = InterTabController?.Partition.ToString();
var item = _dragablzItemsControl.ItemContainerGenerator.ItemFromContainer(e.DragablzItem);
var tabItem = item as TabItem;
if (tabItem != null)
Expand Down