diff --git a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs index 5fd56159..71946c9d 100644 --- a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs @@ -11,6 +11,10 @@ namespace v2rayN.Views public AddServer2Window(ProfileItem profileItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; ViewModel = new AddServer2ViewModel(profileItem, this); diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index f16310e2..e75b304d 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -1,4 +1,5 @@ using ReactiveUI; +using System.Net.Security; using System.Reactive.Disposables; using System.Windows; using System.Windows.Controls; @@ -15,6 +16,10 @@ namespace v2rayN.Views public AddServerWindow(ProfileItem profileItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged; diff --git a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs index d95bc136..f23e32cb 100644 --- a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs @@ -14,6 +14,10 @@ namespace v2rayN.Views public DNSSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; _config = LazyConfig.Instance.GetConfig(); diff --git a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs index 15221b1d..f4c41538 100644 --- a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs @@ -16,6 +16,10 @@ namespace v2rayN.Views public GlobalHotkeySettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; _config = LazyConfig.Instance.GetConfig(); _config.globalHotkeys ??= new List(); diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index ba961f66..1e731078 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -15,8 +15,6 @@ Title="v2rayN" Width="900" Height="700" - MinWidth="900" - MinHeight="700" x:TypeArguments="vms:MainWindowViewModel" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}" diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index d98ab2d5..fad24fd2 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -25,6 +25,10 @@ namespace v2rayN.Views public MainWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + _config = LazyConfig.Instance.GetConfig(); App.Current.SessionEnding += Current_SessionEnding; diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index 7d44263e..d29d06b7 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -18,6 +18,10 @@ namespace v2rayN.Views public OptionSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; _config = LazyConfig.Instance.GetConfig(); diff --git a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs index 45d16c69..400bf64c 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -12,6 +12,10 @@ namespace v2rayN.Views public RoutingRuleDetailsWindow(RulesItem rulesItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; clbProtocol.SelectionChanged += ClbProtocol_SelectionChanged; diff --git a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs index cfdb4432..5a0c8d88 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs @@ -13,6 +13,10 @@ namespace v2rayN.Views public RoutingRuleSettingWindow(RoutingItem routingItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown; diff --git a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs index 0f001dc9..8d4d712c 100644 --- a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs @@ -12,6 +12,10 @@ namespace v2rayN.Views public RoutingSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Closing += RoutingSettingWindow_Closing; this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown; diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs index 00187ce1..4021d176 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs @@ -11,6 +11,10 @@ namespace v2rayN.Views public SubEditWindow(SubItem subItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; diff --git a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs index 7f4eee58..57d4b86a 100644 --- a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs @@ -13,6 +13,10 @@ namespace v2rayN.Views public SubSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; ViewModel = new SubSettingViewModel(this);