mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-27 15:45:06 +03:00
Optimize ViewModel activation lifecycle (#10146)
* Optimize ViewModel activation lifecycle * Fix * Fix * Fix * Set period to 1s
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user