2024-02-05 23:08:37 -08:00
|
|
|
using Avalonia.Controls;
|
|
|
|
using Avalonia.Input;
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
namespace SourceGit.Views
|
|
|
|
{
|
|
|
|
public partial class RevisionCompare : UserControl
|
|
|
|
{
|
|
|
|
public RevisionCompare()
|
|
|
|
{
|
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-05-28 06:19:53 -07:00
|
|
|
if (DataContext is ViewModels.RevisionCompare vm && sender is ChangeCollectionView view)
|
2024-03-17 18:37:06 -07:00
|
|
|
{
|
2024-05-28 06:19:53 -07:00
|
|
|
var menu = vm.CreateChangeContextMenu();
|
|
|
|
view.OpenContextMenu(menu);
|
2024-02-05 23:08:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
|
|
|
{
|
2024-05-28 06:19:53 -07:00
|
|
|
if (DataContext is ViewModels.RevisionCompare vm && sender is TextBlock block)
|
|
|
|
vm.NavigateTo(block.Text);
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
}
|