fix: SelectableTextBlock does not re-draw after Text property changed (#906)

This commit is contained in:
leo 2025-01-14 21:02:32 +08:00
parent c8aecc00cc
commit 1c8d4d312a
No known key found for this signature in database
2 changed files with 32 additions and 12 deletions

View file

@ -0,0 +1,20 @@
using System;
using Avalonia;
using Avalonia.Controls;
namespace SourceGit.Views
{
public class EnhancedSelectableTextBlock : SelectableTextBlock
{
protected override Type StyleKeyOverride => typeof(SelectableTextBlock);
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);
if (change.Property == TextProperty)
UpdateLayout();
}
}
}