Optimize ViewModel activation lifecycle (#10146)

* Optimize ViewModel activation lifecycle

* Fix

* Fix

* Fix

* Set period to 1s
This commit is contained in:
DHR60
2026-09-12 09:48:27 +00:00
committed by GitHub
parent 4f5a6be12d
commit cef40d38ee
8 changed files with 129 additions and 124 deletions
+2 -5
View File
@@ -16,15 +16,12 @@ public partial class MsgView : ReactiveUserControl<MsgViewModel>
this.Bind(ViewModel, vm => vm.MsgFilter, v => v.cmbMsgFilter.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.AutoRefresh, v => v.togAutoRefresh.IsChecked).DisposeWith(disposables);
ViewModel.DispatcherShowMsgInteraction.RegisterHandler(interaction =>
ViewModel.ShowMsgInteraction.RegisterHandler(interaction =>
{
var msg = interaction.Input;
Dispatcher.UIThread.Post(() => ShowMsg(msg),
DispatcherPriority.ApplicationIdle);
ShowMsg(msg);
interaction.SetOutput(RxVoid.Default);
}).DisposeWith(disposables);
ViewModel?.FlushQueueMsg();
});
TextEditorKeywordHighlighter.Attach(txtMsg, Global.LogLevelColors.ToDictionary(