mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-27 21:27:19 -08:00
163e8cc0a4
Signed-off-by: leo <longshuang@msn.cn>
25 lines
666 B
C#
25 lines
666 B
C#
using Avalonia.Controls;
|
|
|
|
namespace SourceGit.Views
|
|
{
|
|
public partial class CommitChanges : UserControl
|
|
{
|
|
public CommitChanges()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
|
|
{
|
|
if (sender is ChangeCollectionView { SelectedChanges: { } selected } view &&
|
|
selected.Count == 1 &&
|
|
DataContext is ViewModels.CommitDetail vm)
|
|
{
|
|
var menu = vm.CreateChangeContextMenu(selected[0]);
|
|
menu?.Open(view);
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|