mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
35 lines
1 KiB
C#
35 lines
1 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
|
|
namespace SourceGit.Views
|
|
{
|
|
public partial class CommitDetail : UserControl
|
|
{
|
|
public CommitDetail()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnChangeDoubleTapped(object sender, TappedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.CommitDetail detail && sender is Grid grid && grid.DataContext is Models.Change change)
|
|
{
|
|
detail.ActivePageIndex = 1;
|
|
detail.SelectedChanges = new() { change };
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
|
|
private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.CommitDetail detail && sender is Grid grid && grid.DataContext is Models.Change change)
|
|
{
|
|
var menu = detail.CreateChangeContextMenu(change);
|
|
grid.OpenContextMenu(menu);
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|