From 390f0dde6a58c601b2239f7b1ada5a3f042dde45 Mon Sep 17 00:00:00 2001 From: TopProgrammer77 Date: Mon, 22 May 2023 13:06:28 -0400 Subject: [PATCH] fix(TreeView): prevent throwing exception --- src/Uno.UI/Microsoft/UI/Xaml/Controls/TreeView/TreeViewList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/TreeView/TreeViewList.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/TreeView/TreeViewList.cs index 8808d23ad69a..6e92fb653cb4 100644 --- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/TreeView/TreeViewList.cs +++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/TreeView/TreeViewList.cs @@ -194,7 +194,7 @@ protected override void OnDragOver(Windows.UI.Xaml.DragEventArgs args) if (!args.Handled) { args.AcceptedOperation = DataPackageOperation.None; - IInsertionPanel insertionPanel = (IInsertionPanel)ItemsPanelRoot; + IInsertionPanel insertionPanel = ItemsPanelRoot as IInsertionPanel; // reorder is only supported with panels that implement IInsertionPanel if (insertionPanel != null && m_draggedTreeViewNode != null && CanReorderItems)