diff --git a/src/Views/AIAssistant.axaml b/src/Views/AIAssistant.axaml
index c9a37f3b..96ce56ec 100644
--- a/src/Views/AIAssistant.axaml
+++ b/src/Views/AIAssistant.axaml
@@ -39,12 +39,12 @@
+ Background="{DynamicResource Brush.Contents}"
+ Content="{Binding Text}"/>
diff --git a/src/Views/AIAssistant.axaml.cs b/src/Views/AIAssistant.axaml.cs
index f8519b7c..f865cabe 100644
--- a/src/Views/AIAssistant.axaml.cs
+++ b/src/Views/AIAssistant.axaml.cs
@@ -15,6 +15,15 @@ namespace SourceGit.Views
{
public class AIResponseView : TextEditor
{
+ public static readonly StyledProperty ContentProperty =
+ AvaloniaProperty.Register(nameof(Content), string.Empty);
+
+ public string Content
+ {
+ get => GetValue(ContentProperty);
+ set => SetValue(ContentProperty, value);
+ }
+
protected override Type StyleKeyOverride => typeof(TextEditor);
public AIResponseView() : base(new TextArea(), new TextDocument())
@@ -58,6 +67,16 @@ namespace SourceGit.Views
GC.Collect();
}
+ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
+ {
+ base.OnPropertyChanged(change);
+
+ if (change.Property == ContentProperty)
+ {
+ Text = Content;
+ }
+ }
+
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)
{
var selected = SelectedText;