1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Profile editor - Fixed freeze on delete

This commit is contained in:
Robert 2021-06-12 22:54:55 +02:00
parent 3f22ebae8a
commit 10c80fb9c2
3 changed files with 4 additions and 7 deletions

View File

@ -95,7 +95,7 @@
</ContextMenu>
</TreeView.ContextMenu>
<b:Interaction.Behaviors>
<behaviors:TreeViewSelectionBehavior SelectedItem="{Binding SelectedTreeItem, IsAsync=True}" />
<behaviors:TreeViewSelectionBehavior SelectedItem="{Binding SelectedTreeItem}" />
</b:Interaction.Behaviors>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type treeItem:FolderViewModel}" ItemsSource="{Binding Items}">

View File

@ -33,11 +33,8 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
get => _selectedTreeItem;
set
{
if (_updatingTree) return;
if (!SetAndNotify(ref _selectedTreeItem, value)) return;
if (_draggingTreeView) return;
ApplySelectedTreeItem();
if (!_updatingTree && SetAndNotify(ref _selectedTreeItem, value) && !_draggingTreeView)
ApplySelectedTreeItem();
}
}

View File

@ -184,6 +184,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
else
newSelection = ProfileElement.Parent;
}
_profileEditorService.ChangeSelectedProfileElement(newSelection as RenderProfileElement);
// Farewell, cruel world
TreeItemViewModel parent = (TreeItemViewModel) Parent;
@ -191,7 +192,6 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem
parent.RemoveExistingElement(this);
_profileEditorService.SaveSelectedProfileConfiguration();
_profileEditorService.ChangeSelectedProfileElement(newSelection as RenderProfileElement);
}
public void DuplicateElement()