Add event-driven quick action dispatch

This commit is contained in:
Drechsler, Meik
2026-07-22 11:57:32 +02:00
parent fb45f1c42b
commit 9bd3896ba0
20 changed files with 591 additions and 139 deletions

View File

@@ -155,29 +155,6 @@ namespace FasdDesktopUi.Basics.UserControls
#region Methods
private void NotepadRichTextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
try
{
if (_dataProvider is null)
return;
if (_dataProvider?.CaseNotes?.Parent is RichTextBox parentBox)
parentBox.Document = new FlowDocument();
if (!(sender is RichTextBox senderElement))
return;
senderElement.Document = _dataProvider.CaseNotes;
senderElement.CaretPosition = senderElement.CaretPosition.DocumentEnd;
}
catch (Exception E)
{
LogException(E);
}
}
private async void NotepadRichTextBox_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
try
@@ -185,11 +162,15 @@ namespace FasdDesktopUi.Basics.UserControls
if (!(e.NewValue is bool isVisible && isVisible))
return;
await Task.Delay(50);
NotepadRichTextBox.Focus();
Keyboard.Focus(NotepadRichTextBox);
if (!(sender is RichTextBox senderElement))
return;
NotepadRichTextBox_GotKeyboardFocus(sender, null);
senderElement.Document = _dataProvider.CaseNotes;
senderElement.CaretPosition = senderElement.CaretPosition.DocumentEnd;
await Task.Delay(50);
senderElement.Focus();
Keyboard.Focus(senderElement);
}
catch (Exception E)
{