mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
27 lines
751 B
C#
27 lines
751 B
C#
using Avalonia.Controls;
|
|
|
|
namespace SourceGit.Views
|
|
{
|
|
public partial class CommitChanges : UserControl
|
|
{
|
|
public CommitChanges()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.CommitDetail vm)
|
|
{
|
|
var selected = (sender as ChangeCollectionView)?.SelectedChanges;
|
|
if (selected != null && selected.Count == 1)
|
|
{
|
|
var menu = vm.CreateChangeContextMenu(selected[0]);
|
|
(sender as Control)?.OpenContextMenu(menu);
|
|
}
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|