2024-02-05 23:08:37 -08:00
|
|
|
using Avalonia.Controls;
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
namespace SourceGit.Views
|
|
|
|
{
|
|
|
|
public partial class CommitChanges : UserControl
|
|
|
|
{
|
|
|
|
public CommitChanges()
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
|
2024-05-28 06:19:53 -07:00
|
|
|
private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
|
2024-03-17 18:37:06 -07:00
|
|
|
{
|
2024-07-14 00:55:15 -07:00
|
|
|
if (sender is ChangeCollectionView { SelectedChanges: { } selected } view &&
|
|
|
|
selected.Count == 1 &&
|
|
|
|
DataContext is ViewModels.CommitDetail vm)
|
2024-03-17 18:37:06 -07:00
|
|
|
{
|
2024-07-14 00:55:15 -07:00
|
|
|
var menu = vm.CreateChangeContextMenu(selected[0]);
|
|
|
|
view.OpenContextMenu(menu);
|
2024-05-29 05:48:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
2024-02-05 23:08:37 -08:00
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
}
|