diff --git a/Dragablz/Dockablz/Layout.cs b/Dragablz/Dockablz/Layout.cs index e86e89a8..43836028 100644 --- a/Dragablz/Dockablz/Layout.cs +++ b/Dragablz/Dockablz/Layout.cs @@ -1,5 +1,4 @@ using System; -using System.CodeDom; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -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))); + /// /// Use in conjuction with the on a /// to isolate drag and drop spaces/control instances. /// - public string Partition { get; set; } + public object Partition + { + get { return (object) GetValue(PartitionProperty); } + set { SetValue(PartitionProperty, value); } + } + /// + /// Use in conjuction with the on a + /// to isolate drag and drop spaces/control instances. + /// + //public string Partition { get; set; } + public static readonly DependencyProperty InterLayoutClientProperty = DependencyProperty.Register( "InterLayoutClient", typeof (IInterLayoutClient), typeof (Layout), new PropertyMetadata(new DefaultInterLayoutClient())); @@ -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))) { diff --git a/Dragablz/InterTabController.cs b/Dragablz/InterTabController.cs index 6853e452..0353aa16 100644 --- a/Dragablz/InterTabController.cs +++ b/Dragablz/InterTabController.cs @@ -1,5 +1,4 @@ -using System.Dynamic; -using System.Windows; +using System.Windows; namespace Dragablz { @@ -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))); @@ -62,12 +60,13 @@ public object Partition get { return (object) GetValue(PartitionProperty); } set { SetValue(PartitionProperty, value); } } - */ + /* /// /// 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. null is a valid partition (i.e global). /// public string Partition { get; set; } + */ } } \ No newline at end of file diff --git a/Dragablz/TabablzControl.cs b/Dragablz/TabablzControl.cs index c1617708..937c6831 100644 --- a/Dragablz/TabablzControl.cs +++ b/Dragablz/TabablzControl.cs @@ -973,7 +973,7 @@ private void ItemDragStarted(object sender, DragablzDragStartedEventArgs e) foreach (var otherItem in _dragablzItemsControl.Containers().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)