From 531e0e94433aed515d4583ee34109c9b787e7432 Mon Sep 17 00:00:00 2001 From: DHR60 <192860629+DHR60@users.noreply.github.com> Date: Sat, 18 Jul 2026 09:45:42 +0000 Subject: [PATCH] Fix (#9787) --- .../v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs | 10 +++++----- v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs | 10 +++++----- .../Views/RoutingRuleDetailsWindow.axaml.cs | 10 +++++----- v2rayN/v2rayN/Views/AddGroupServerWindow.xaml.cs | 10 +++++----- v2rayN/v2rayN/Views/AddServerWindow.xaml.cs | 10 +++++----- v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs index 1d51551a..8a828cfa 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddGroupServerWindow.axaml.cs @@ -26,6 +26,11 @@ public partial class AddGroupServerWindow : WindowBase this.WhenActivated(disposables => { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Remarks, v => v.txtRemarks.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType, v => v.cmbCoreType.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.PolicyGroupType, v => v.cmbPolicyGroupType.SelectedValue).DisposeWith(disposables); @@ -43,11 +48,6 @@ public partial class AddGroupServerWindow : WindowBase this.BindCommand(ViewModel, vm => vm.MoveBottomCmd, v => v.menuMoveBottom).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); // Context menu actions that require custom logic (Add, SelectAll) diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs index ed1f74a9..58c58479 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs @@ -38,6 +38,11 @@ public partial class AddServerWindow : WindowBase this.WhenActivated(disposables => { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + var configTypeBindings = new SerialDisposable().DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType, v => v.cmbCoreType.SelectedValue).DisposeWith(disposables); @@ -188,11 +193,6 @@ public partial class AddServerWindow : WindowBase this.BindCommand(ViewModel, vm => vm.FetchCertCmd, v => v.btnFetchCert).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.FetchCertChainCmd, v => v.btnFetchCertChain).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); } diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs index 82546ced..7124e561 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs @@ -21,6 +21,11 @@ public partial class RoutingRuleDetailsWindow : WindowBase { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.OutboundTag, v => v.cmbOutboundTag.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.Remarks, v => v.txtRemarks.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.OutboundTag, v => v.cmbOutboundTag.Text).DisposeWith(disposables); @@ -35,11 +40,6 @@ public partial class RoutingRuleDetailsWindow : WindowBase vm.SelectProfileCmd, v => v.btnSelectProfile).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); } diff --git a/v2rayN/v2rayN/Views/AddGroupServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddGroupServerWindow.xaml.cs index 20c549fc..0c01660e 100644 --- a/v2rayN/v2rayN/Views/AddGroupServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddGroupServerWindow.xaml.cs @@ -25,6 +25,11 @@ public partial class AddGroupServerWindow this.WhenActivated(disposables => { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Remarks, v => v.txtRemarks.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType, v => v.cmbCoreType.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.PolicyGroupType, v => v.cmbPolicyGroupType.Text).DisposeWith(disposables); @@ -45,11 +50,6 @@ public partial class AddGroupServerWindow this.BindCommand(ViewModel, vm => vm.MoveBottomCmd, v => v.menuMoveBottom).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); WindowsUtils.SetDarkBorder(this, AppManager.Instance.Config.UiItem.CurrentTheme); } diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index 94f5952d..d958437a 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -36,6 +36,11 @@ public partial class AddServerWindow this.WhenActivated(disposables => { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + var configTypeBindings = new SerialDisposable().DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType, v => v.cmbCoreType.Text).DisposeWith(disposables); @@ -186,11 +191,6 @@ public partial class AddServerWindow this.BindCommand(ViewModel, vm => vm.FetchCertCmd, v => v.btnFetchCert).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.FetchCertChainCmd, v => v.btnFetchCertChain).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); WindowsUtils.SetDarkBorder(this, AppManager.Instance.Config.UiItem.CurrentTheme); diff --git a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs index 94aaa9fe..2a7ace02 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -18,6 +18,11 @@ public partial class RoutingRuleDetailsWindow this.WhenActivated(disposables => { + this.WhenAnyValue(v => v.ViewModel.SelectedSource) + .WhereNotNull() + .Subscribe(InitializeData) + .DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Remarks, v => v.txtRemarks.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.OutboundTag, v => v.cmbOutboundTag.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.Port, v => v.txtPort.Text).DisposeWith(disposables); @@ -31,11 +36,6 @@ public partial class RoutingRuleDetailsWindow this.BindCommand(ViewModel, vm => vm.SelectProfileCmd, v => v.btnSelectProfile).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); - - this.WhenAnyValue(v => v.ViewModel.SelectedSource) - .WhereNotNull() - .Subscribe(InitializeData) - .DisposeWith(disposables); }); WindowsUtils.SetDarkBorder(this, AppManager.Instance.Config.UiItem.CurrentTheme); }