mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
163e8cc0a4
Signed-off-by: leo <longshuang@msn.cn>
32 lines
854 B
C#
32 lines
854 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
|
|
namespace SourceGit.Views
|
|
{
|
|
public partial class BranchCompare : ChromelessWindow
|
|
{
|
|
public BranchCompare()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.BranchCompare vm && sender is ChangeCollectionView view)
|
|
{
|
|
var menu = vm.CreateChangeContextMenu();
|
|
menu?.Open(view);
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
|
|
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
|
|
{
|
|
if (DataContext is ViewModels.BranchCompare vm && sender is TextBlock block)
|
|
vm.NavigateTo(block.Text);
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|