Skip to content

Commit

Permalink
perf: implement custom flag for TreeViewList
Browse files Browse the repository at this point in the history
  • Loading branch information
TopProgrammer77 authored and ahmed605 committed Sep 13, 2023
1 parent 19cd250 commit 562545e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public partial class TreeViewList : ListView
public TreeViewList()
{
ListViewModel = new TreeViewViewModel();

IsCustomReorder = true;
DragItemsStarting += OnDragItemsStarting;
DragItemsCompleted += OnDragItemsCompleted;
ContainerContentChanging += OnContainerContentChanging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ partial class ListViewBase
private const string ReorderItemFormatId = DataPackage.UnoPrivateDataPrefix + "__list__view__base__source__item__";
private const string ReorderContainerFormatId = DataPackage.UnoPrivateDataPrefix + "__list__view__base__source__container__";
private const string DragItemsFormatId = DataPackage.UnoPrivateDataPrefix + "__list__view__base__items__";
internal bool IsCustomReorder;

public event DragItemsStartingEventHandler DragItemsStarting;
public event TypedEventHandler<ListViewBase, DragItemsCompletedEventArgs> DragItemsCompleted;
Expand Down Expand Up @@ -153,7 +154,7 @@ private static void OnItemContainerDragStarting(UIElement sender, DragStartingEv
that.DragLeave -= OnReorderDragLeave;
that.Drop -= OnReorderCompleted;

if (that is not Microsoft.UI.Xaml.Controls.TreeViewList)
if (!that.IsCustomReorder)
{
that.DragEnter += OnReorderDragUpdated;
that.DragOver += OnReorderDragUpdated;
Expand Down

0 comments on commit 562545e

Please sign in to comment.