2024-05-28 21:50:26 -07:00
|
|
|
using Avalonia;
|
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 CommitBaseInfo : UserControl
|
|
|
|
{
|
2024-05-28 21:50:26 -07:00
|
|
|
public static readonly StyledProperty<bool> CanNavigateProperty =
|
|
|
|
AvaloniaProperty.Register<CommitBaseInfo, bool>(nameof(CanNavigate), true);
|
|
|
|
|
|
|
|
public bool CanNavigate
|
|
|
|
{
|
|
|
|
get => GetValue(CanNavigateProperty);
|
|
|
|
set => SetValue(CanNavigateProperty, value);
|
|
|
|
}
|
2024-06-13 18:46:30 -07:00
|
|
|
|
2024-06-07 21:19:48 -07:00
|
|
|
public static readonly StyledProperty<string> MessageProperty =
|
|
|
|
AvaloniaProperty.Register<CommitBaseInfo, string>(nameof(Message), string.Empty);
|
|
|
|
|
|
|
|
public string Message
|
|
|
|
{
|
|
|
|
get => GetValue(MessageProperty);
|
|
|
|
set => SetValue(MessageProperty, value);
|
|
|
|
}
|
2024-05-28 21:50:26 -07:00
|
|
|
|
2024-08-05 02:34:49 -07:00
|
|
|
public static readonly StyledProperty<ViewModels.IssueTrackerRuleSetting> IssueTrackerSettingProperty =
|
|
|
|
AvaloniaProperty.Register<CommitBaseInfo, ViewModels.IssueTrackerRuleSetting>(nameof(IssueTrackerSetting));
|
|
|
|
|
|
|
|
public ViewModels.IssueTrackerRuleSetting IssueTrackerSetting
|
|
|
|
{
|
|
|
|
get => GetValue(IssueTrackerSettingProperty);
|
|
|
|
set => SetValue(IssueTrackerSettingProperty, value);
|
|
|
|
}
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
public CommitBaseInfo()
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
private void OnParentSHAPressed(object sender, PointerPressedEventArgs e)
|
|
|
|
{
|
2024-07-14 00:55:15 -07:00
|
|
|
if (sender is Control { DataContext: string sha } &&
|
|
|
|
DataContext is ViewModels.CommitDetail detail &&
|
|
|
|
CanNavigate)
|
|
|
|
{
|
|
|
|
detail.NavigateTo(sha);
|
|
|
|
}
|
2024-06-06 00:31:02 -07:00
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
e.Handled = true;
|
|
|
|
}
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
}
|