Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 2.18 KB

CHANGELOG.md

File metadata and controls

22 lines (17 loc) · 2.18 KB

Features and fixes:

  • Upgrade to .NET 8

  • Fix right click and drag will "lock" tab item via this comment and Dragablz#275

    Files changed:

    • DragablzItem.cs (
      protected override async void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
      {
      if (_thumb != null)
      {
      var currentThumbIsHitTestVisible = _thumb.IsHitTestVisible;
      _thumb.SetCurrentValue(IsHitTestVisibleProperty, false);
      while (Mouse.RightButton == MouseButtonState.Pressed)
      {
      await Task.Delay(25);
      };
      _thumb.SetCurrentValue(IsHitTestVisibleProperty, currentThumbIsHitTestVisible);
      }
      base.OnPreviewMouseRightButtonDown(e);
      }
      )
  • Use DependencyProperty for Partition in InterTabController and Layout to allow binding via Dragablz#275

    Files changed:

    • InterTabController.cs (
      public static readonly DependencyProperty PartitionProperty = DependencyProperty.Register(
      "Partition", typeof (object), typeof (InterTabController), new PropertyMetadata(default(object)));
      /// <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 object Partition
      {
      get { return (object) GetValue(PartitionProperty); }
      set { SetValue(PartitionProperty, value); }
      }
      )
    • TabablzControl.cs (
      e.DragablzItem.PartitionAtDragStart = InterTabController?.Partition.ToString();
      )
    • Dockablz\Layout.cs (
      // 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 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; }
      ,
      l.Partition?.ToString() == dragablzItem.PartitionAtDragStart &&
      )
  • Fix closing tab in layout branch if TabEmptiedResponse.DoNothing

    Files changed: - TabEmptiedResponse.cs (

    /// <summary>
    /// Allow the Layout branch to be closed automatically, but not the window.
    /// </summary>
    CloseLayoutBranch,
    ) - TabablzControl.cs (
    internal object RemoveItem(DragablzItem dragablzItem)
    {
    var item = _dragablzItemsControl.ItemContainerGenerator.ItemFromContainer(dragablzItem);
    //stop the header shrinking if the tab stays open when empty
    var minSize = EmptyHeaderSizingHint == EmptyHeaderSizingHint.PreviousTab
    ? new Size(_dragablzItemsControl.ActualWidth, _dragablzItemsControl.ActualHeight)
    : new Size();
    _dragablzItemsControl.MinHeight = 0;
    _dragablzItemsControl.MinWidth = 0;
    var contentPresenter = FindChildContentPresenter(item);
    RemoveFromSource(item);
    _itemsHolder.Children.Remove(contentPresenter);
    if (Items.Count != 0)
    return item;
    // Find window
    var window = Window.GetWindow(this);
    if (window == null || InterTabController == null)
    {
    _dragablzItemsControl.MinHeight = minSize.Height;
    _dragablzItemsControl.MinWidth = minSize.Width;
    return item;
    }
    // Get tab emptied response
    var tabEmptiedResponse = InterTabController.InterTabClient.TabEmptiedHandler(this, window);
    // This is e.g. to DoNothing
    if (tabEmptiedResponse is not (TabEmptiedResponse.CloseLayoutBranch
    or TabEmptiedResponse.CloseWindowOrLayoutBranch))
    {
    _dragablzItemsControl.MinHeight = minSize.Height;
    _dragablzItemsControl.MinWidth = minSize.Width;
    return item;
    }
    // Consolidate branch
    if (Layout.ConsolidateBranch(this))
    return item;
    // Close window
    if (tabEmptiedResponse is TabEmptiedResponse.CloseWindowOrLayoutBranch)
    {
    try
    {
    SetIsClosingAsPartOfDragOperation(window, true);
    window.Close();
    }
    finally
    {
    SetIsClosingAsPartOfDragOperation(window, false);
    }
    }
    return item;
    }
    )

  • Feature: DependencyProperty to disable consolidate branch in TabalzControl added (e.g. to keep the main TabablzControl that is responsible for creating new tabs) Files changed: - TabablzControl.cs (

    internal object RemoveItem(DragablzItem dragablzItem)
    {
    var item = _dragablzItemsControl.ItemContainerGenerator.ItemFromContainer(dragablzItem);
    //stop the header shrinking if the tab stays open when empty
    var minSize = EmptyHeaderSizingHint == EmptyHeaderSizingHint.PreviousTab
    ? new Size(_dragablzItemsControl.ActualWidth, _dragablzItemsControl.ActualHeight)
    : new Size();
    _dragablzItemsControl.MinHeight = 0;
    _dragablzItemsControl.MinWidth = 0;
    var contentPresenter = FindChildContentPresenter(item);
    RemoveFromSource(item);
    _itemsHolder.Children.Remove(contentPresenter);
    // Return if it is not the last item
    if (Items.Count != 0)
    return item;
    // Set min size
    _dragablzItemsControl.MinHeight = minSize.Height;
    _dragablzItemsControl.MinWidth = minSize.Width;
    // Disable branch consolidation (close branch or window is ignored)
    if (DisableBranchConsolidation)
    return item;
    // Find window
    var window = Window.GetWindow(this);
    if (window == null || InterTabController == null)
    return item;
    // Get tab emptied response
    var tabEmptiedResponse = InterTabController.InterTabClient.TabEmptiedHandler(this, window);
    // This is e.g. to DoNothing
    if (tabEmptiedResponse is not (TabEmptiedResponse.CloseLayoutBranch or TabEmptiedResponse.CloseWindowOrLayoutBranch))
    return item;
    // Consolidate branch
    if (Layout.ConsolidateBranch(this))
    return item;
    // Close window
    if (tabEmptiedResponse is TabEmptiedResponse.CloseWindowOrLayoutBranch)
    {
    try
    {
    SetIsClosingAsPartOfDragOperation(window, true);
    window.Close();
    }
    finally
    {
    SetIsClosingAsPartOfDragOperation(window, false);
    }
    }
    return item;
    }
    ,
    public static readonly DependencyProperty DisableBranchConsolidationProperty = DependencyProperty.Register(
    "DisableBranchConsolidation", typeof (bool), typeof (TabablzControl), new PropertyMetadata(default(bool)));
    /// <summary>
    /// Disable the consolidation of branches when a tab is dragged out of a branch. Set it to <c>true</c> if you have
    /// a main TabablzControl that is used to create new tab items and you don't want to remove this TabaBlzControl
    /// when the last tab is dragged out. In dynamically created TabablzControls this property should then be set to
    /// <c>false</c> (default).
    /// If this is set to <c>true</c> the <see cref="TabEmptiedResponse.CloseLayoutBranch"/> and <see cref="TabEmptiedResponse.CloseWindowOrLayoutBranch"/>
    /// is ignored.
    /// </summary>
    public bool DisableBranchConsolidation
    {
    get { return (bool) GetValue(DisableBranchConsolidationProperty); }
    set { SetValue(DisableBranchConsolidationProperty, value); }
    }
    ,
    if (Items.Count == 0)
    {
    _dragablzItemsControl.MinHeight = minSize.Height;
    _dragablzItemsControl.MinWidth = minSize.Width;
    if(!DisableBranchConsolidation)
    Layout.ConsolidateBranch(this);
    }
    )