enhance: disable some MenuItems if repository that linked by node has been auto-removed from Preference (#90).

This commit is contained in:
leo 2024-04-28 13:51:44 +08:00
parent 9b5e8429b9
commit 32e685622b
3 changed files with 81 additions and 34 deletions

View file

@ -37,6 +37,16 @@ namespace SourceGit.Views
}
}
private void OnTreeNodeContextRequested(object sender, ContextRequestedEventArgs e)
{
if (sender is Grid grid && DataContext is ViewModels.Welcome vm)
{
var menu = vm.CreateContextMenu(grid.DataContext as ViewModels.RepositoryNode);
menu?.Open(grid);
e.Handled = true;
}
}
private void OnPointerPressedTreeNode(object sender, PointerPressedEventArgs e)
{
if (e.GetCurrentPoint(sender as Visual).Properties.IsLeftButtonPressed)