Add event-driven quick action dispatch
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user