mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 10:55:00 +00:00
Fix counter issue
This commit is contained in:
parent
ac57c930cb
commit
11ad7f56d9
4 changed files with 123 additions and 28 deletions
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Avalonia;
|
||||
|
@ -70,6 +71,25 @@ namespace SourceGit.Views
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnDataContextChanged(EventArgs e)
|
||||
{
|
||||
base.OnDataContextChanged(e);
|
||||
|
||||
// When the DataContext changes, we need to re-evaluate any bindings
|
||||
// This ensures that when the Commit property changes, the UI is updated
|
||||
if (DataContext is ViewModels.CommitDetail detail)
|
||||
{
|
||||
detail.PropertyChanged += (s, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(detail.Commit))
|
||||
{
|
||||
// Force UI update for the commit lines
|
||||
InvalidateVisual();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCopyCommitSHA(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { DataContext: Models.Commit commit })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue