diff --git a/Source/NETworkManager.Models/Network/DNSLookup.cs b/Source/NETworkManager.Models/Network/DNSLookup.cs index 6afe12d0b9..556a91763b 100644 --- a/Source/NETworkManager.Models/Network/DNSLookup.cs +++ b/Source/NETworkManager.Models/Network/DNSLookup.cs @@ -232,8 +232,6 @@ private void ProcessDnsAnswers(IEnumerable answers, NameServe if (answers is not DnsResourceRecord[] dnsResourceRecords) return; - Debug.WriteLine(dnsResourceRecords); - // A foreach (var record in dnsResourceRecords.OfType()) OnRecordReceived(new DNSLookupRecordReceivedArgs( diff --git a/Source/NETworkManager.Profiles/IProfileManagerMinimal.cs b/Source/NETworkManager.Profiles/IProfileManagerMinimal.cs index 1950391bd5..4832dfbedd 100644 --- a/Source/NETworkManager.Profiles/IProfileManagerMinimal.cs +++ b/Source/NETworkManager.Profiles/IProfileManagerMinimal.cs @@ -11,6 +11,7 @@ public interface IProfileManagerMinimal /// public void OnProfileManagerDialogOpen() { + } /// @@ -18,5 +19,6 @@ public void OnProfileManagerDialogOpen() /// public void OnProfileManagerDialogClose() { + } -} \ No newline at end of file +} diff --git a/Source/NETworkManager.Utilities.WPF/BindingProxy.cs b/Source/NETworkManager.Utilities.WPF/BindingProxy.cs index d35f951fc6..8906a9febf 100644 --- a/Source/NETworkManager.Utilities.WPF/BindingProxy.cs +++ b/Source/NETworkManager.Utilities.WPF/BindingProxy.cs @@ -17,4 +17,4 @@ protected override Freezable CreateInstanceCore() { return new BindingProxy(); } -} \ No newline at end of file +} diff --git a/Source/NETworkManager.Validators/ProfileFileUniqueValidator.cs b/Source/NETworkManager.Validators/ProfileFileUniqueValidator.cs index 0f4b524fba..4d7fdc15fa 100644 --- a/Source/NETworkManager.Validators/ProfileFileUniqueValidator.cs +++ b/Source/NETworkManager.Validators/ProfileFileUniqueValidator.cs @@ -1,4 +1,5 @@ -using System.Globalization; +using System; +using System.Globalization; using System.Linq; using System.Windows.Controls; using NETworkManager.Localization.Resources; @@ -10,7 +11,8 @@ public class ProfileFileUniqueValidator : ValidationRule { public override ValidationResult Validate(object value, CultureInfo cultureInfo) { - return ProfileManager.ProfileFiles.Any(x => x.Name == value as string) + return ProfileManager.ProfileFiles.Any(x => + string.Equals(x.Name, value as string, StringComparison.OrdinalIgnoreCase)) ? new ValidationResult(false, Strings.ProfileNameAlreadyExists) : ValidationResult.ValidResult; } diff --git a/Source/NETworkManager/MainWindow.xaml b/Source/NETworkManager/MainWindow.xaml index 0003695288..b7543c4c43 100644 --- a/Source/NETworkManager/MainWindow.xaml +++ b/Source/NETworkManager/MainWindow.xaml @@ -238,16 +238,25 @@ diff --git a/Source/NETworkManager/MainWindow.xaml.cs b/Source/NETworkManager/MainWindow.xaml.cs index 8d89e1d99c..2283b044c9 100644 --- a/Source/NETworkManager/MainWindow.xaml.cs +++ b/Source/NETworkManager/MainWindow.xaml.cs @@ -472,7 +472,6 @@ await this.ShowMessageAsync(Strings.SettingsHaveBeenReset, // Show welcome dialog if (SettingsManager.Current.WelcomeDialog_Show) { - var childWindow = new WelcomeChildWindow(); var viewModel = new WelcomeViewModel(instance => @@ -1443,6 +1442,8 @@ private async void LoadProfile(ProfileFileInfo info, bool showWrongPassword = fa ProfileManager.Unload(); }, info.Name, showWrongPassword); + childWindow.Title = Strings.UnlockProfileFile; + childWindow.DataContext = viewModel; ConfigurationManager.OnDialogOpen(); diff --git a/Source/NETworkManager/NETworkManager.csproj b/Source/NETworkManager/NETworkManager.csproj index a64d71b66d..e6165da77b 100644 --- a/Source/NETworkManager/NETworkManager.csproj +++ b/Source/NETworkManager/NETworkManager.csproj @@ -141,6 +141,11 @@ Wpf Designer + + MSBuild:Compile + Wpf + Designer + diff --git a/Source/NETworkManager/ProfileDialogManager.cs b/Source/NETworkManager/ProfileDialogManager.cs index f7666e03c8..94cae98c51 100644 --- a/Source/NETworkManager/ProfileDialogManager.cs +++ b/Source/NETworkManager/ProfileDialogManager.cs @@ -9,9 +9,12 @@ using NETworkManager.Views; using System; using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; using System.Security; using System.Threading.Tasks; using System.Windows; +using MahApps.Metro.SimpleChildWindow; namespace NETworkManager; @@ -306,7 +309,7 @@ private static GroupInfo ParseGroupInfo(GroupViewModel instance) { Name = name, Description = instance.Description?.Trim(), - + Profiles = profiles, // Remote Desktop @@ -466,133 +469,138 @@ private static GroupInfo ParseGroupInfo(GroupViewModel instance) #region Dialog to add, edit, copy as and delete profile - public static Task ShowAddProfileDialog(object context, IProfileManagerMinimal viewModel, - IDialogCoordinator dialogCoordinator, ProfileInfo profile = null, string group = null, + public static Task ShowAddProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel, + ProfileInfo profile = null, string group = null, ApplicationName applicationName = ApplicationName.None) { - CustomDialog customDialog = new() - { - Title = Strings.AddProfile, - Style = (Style)Application.Current.FindResource(DialogResourceKey) - }; + var childWindow = new ProfileChildWindow(parentWindow); - ProfileViewModel profileViewModel = new(async instance => + ProfileViewModel childWindowViewModel = new(instance => { - await dialogCoordinator.HideMetroDialogAsync(context, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); ProfileManager.AddProfile(ParseProfileInfo(instance)); - }, async _ => + }, _ => { - await dialogCoordinator.HideMetroDialogAsync(context, customDialog); + Debug.WriteLine("Profile dialog closed without saving"); + + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); }, ProfileManager.GetGroupNames(), group, ProfileEditMode.Add, profile, applicationName); - customDialog.Content = new ProfileDialog - { - DataContext = profileViewModel - }; + childWindow.Title = Strings.AddProfile; - viewModel.OnProfileManagerDialogOpen(); + childWindow.DataContext = childWindowViewModel; - return dialogCoordinator.ShowMetroDialogAsync(context, customDialog); + viewModel.OnProfileManagerDialogOpen(); + + Settings.ConfigurationManager.Current.IsChildWindowOpen = true; + + return parentWindow.ShowChildWindowAsync(childWindow); } - public static Task ShowEditProfileDialog(IProfileManagerMinimal viewModel, - IDialogCoordinator dialogCoordinator, ProfileInfo profile) + public static Task ShowEditProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel, + ProfileInfo profile) { - CustomDialog customDialog = new() - { - Title = Strings.EditProfile, - Style = (Style)Application.Current.FindResource(DialogResourceKey) - }; + var childWindow = new ProfileChildWindow(parentWindow); - ProfileViewModel profileViewModel = new(async instance => + ProfileViewModel childWindowViewModel = new(instance => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); ProfileManager.ReplaceProfile(profile, ParseProfileInfo(instance)); - }, async _ => + }, _ => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); }, ProfileManager.GetGroupNames(), profile.Group, ProfileEditMode.Edit, profile); - customDialog.Content = new ProfileDialog - { - DataContext = profileViewModel - }; + childWindow.Title = Strings.EditProfile; - viewModel.OnProfileManagerDialogOpen(); + childWindow.DataContext = childWindowViewModel; - return dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); + viewModel.OnProfileManagerDialogOpen(); + + Settings.ConfigurationManager.Current.IsChildWindowOpen = true; + + return parentWindow.ShowChildWindowAsync(childWindow); } - public static Task ShowCopyAsProfileDialog(IProfileManagerMinimal viewModel, - IDialogCoordinator dialogCoordinator, ProfileInfo profile) + public static Task ShowCopyAsProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel, + ProfileInfo profile) { - CustomDialog customDialog = new() - { - Title = Strings.CopyProfile, - Style = (Style)Application.Current.FindResource(DialogResourceKey) - }; + var childWindow = new ProfileChildWindow(parentWindow); - ProfileViewModel profileViewModel = new(async instance => + ProfileViewModel childWindowViewModel = new(instance => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); ProfileManager.AddProfile(ParseProfileInfo(instance)); - }, async _ => + }, _ => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); }, ProfileManager.GetGroupNames(), profile.Group, ProfileEditMode.Copy, profile); - customDialog.Content = new ProfileDialog - { - DataContext = profileViewModel - }; - + childWindow.Title = Strings.CopyProfile; + + childWindow.DataContext = childWindowViewModel; + viewModel.OnProfileManagerDialogOpen(); + + Settings.ConfigurationManager.Current.IsChildWindowOpen = true; - return dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); + return parentWindow.ShowChildWindowAsync(childWindow); } - public static Task ShowDeleteProfileDialog(IProfileManagerMinimal viewModel, - IDialogCoordinator dialogCoordinator, IList profiles) + public static Task ShowDeleteProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel, + IList profiles) { - CustomDialog customDialog = new() - { - Title = profiles.Count == 1 - ? Strings.DeleteProfile - : Strings.DeleteProfiles - }; - - ConfirmDeleteViewModel confirmDeleteViewModel = new(async _ => + var childWindow = new OKCancelInfoMessageChildWindow(); + + OKCancelInfoMessageViewModel childWindowViewModel = new(_ => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); ProfileManager.RemoveProfiles(profiles); - }, async _ => + }, _ => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); }, profiles.Count == 1 ? Strings.DeleteProfileMessage : Strings.DeleteProfilesMessage); - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; + childWindow.Title = Strings.DeleteProfile; + + childWindow.DataContext = childWindowViewModel; viewModel.OnProfileManagerDialogOpen(); + + Settings.ConfigurationManager.Current.IsChildWindowOpen = true; - return dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); + return parentWindow.ShowChildWindowAsync(childWindow); } #endregion @@ -660,34 +668,36 @@ public static Task ShowEditGroupDialog(IProfileManagerMinimal viewModel, IDialog return dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); } - public static Task ShowDeleteGroupDialog(IProfileManagerMinimal viewModel, - IDialogCoordinator dialogCoordinator, GroupInfo group) + public static Task ShowDeleteGroupDialog(Window parentWindow, IProfileManagerMinimal viewModel, + GroupInfo group) { - CustomDialog customDialog = new() + var childWindow = new OKCancelInfoMessageChildWindow(); + + OKCancelInfoMessageViewModel childWindowViewModel = new(_ => { - Title = Strings.DeleteGroup - }; - - ConfirmDeleteViewModel confirmDeleteViewModel = new(async _ => - { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); ProfileManager.RemoveGroup(group); - }, async _ => + }, _ => { - await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog); + childWindow.IsOpen = false; + Settings.ConfigurationManager.Current.IsChildWindowOpen = false; + viewModel.OnProfileManagerDialogClose(); }, Strings.DeleteGroupMessage); - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; + childWindow.Title = Strings.DeleteGroup; + + childWindow.DataContext = childWindowViewModel; viewModel.OnProfileManagerDialogOpen(); - return dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog); + Settings.ConfigurationManager.Current.IsChildWindowOpen = true; + + return parentWindow.ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/Resources/Styles/RectangleStyles.xaml b/Source/NETworkManager/Resources/Styles/RectangleStyles.xaml index e9d33f5ddf..31585c9008 100644 --- a/Source/NETworkManager/Resources/Styles/RectangleStyles.xaml +++ b/Source/NETworkManager/Resources/Styles/RectangleStyles.xaml @@ -40,7 +40,7 @@ + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs index 5bc0474e38..f1ce710231 100644 --- a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs @@ -443,7 +443,7 @@ private void ConnectProfileExternalAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.AWSSessionManager) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.AWSSessionManager) .ConfigureAwait(false); } @@ -456,14 +456,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -471,7 +471,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } @@ -999,8 +999,8 @@ private void SetProfilesView(ProfileInfo profile = null) Profiles.Filter = o => { if (string.IsNullOrEmpty(Search)) - return true ; - + return true; + if (o is not ProfileInfo info) return false; diff --git a/Source/NETworkManager/ViewModels/AWSSessionManagerSettingsViewModel.cs b/Source/NETworkManager/ViewModels/AWSSessionManagerSettingsViewModel.cs index 04c2160bc6..a2ba562bb3 100644 --- a/Source/NETworkManager/ViewModels/AWSSessionManagerSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/AWSSessionManagerSettingsViewModel.cs @@ -3,10 +3,11 @@ using System.Diagnostics; using System.IO; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; -using System.Windows.Forms; using System.Windows.Input; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Models.AWS; using NETworkManager.Settings; @@ -207,12 +208,12 @@ private void DeleteAWSProfileAction() private void BrowseFileAction() { - var openFileDialog = new OpenFileDialog + var openFileDialog = new System.Windows.Forms.OpenFileDialog { Filter = GlobalStaticConfiguration.ApplicationFileExtensionFilter }; - if (openFileDialog.ShowDialog() == DialogResult.OK) + if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) ApplicationFilePath = openFileDialog.FileName; } @@ -274,27 +275,31 @@ public async Task EditAWSProfile() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async Task DeleteAWSProfile() + private Task DeleteAWSProfile() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteAWSProfile - }; + var childWindow = new OKCancelInfoMessageChildWindow(); - var viewModel = new ConfirmDeleteViewModel(_ => + var childWindowViewModel = new OKCancelInfoMessageViewModel(_ => { - _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.AWSSessionManager_AWSProfiles.Remove(SelectedAWSProfile); - }, _ => { _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, - Strings.DeleteAWSProfileMessage); - - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = viewModel - }; - - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + }, _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, + Strings.DeleteAWSProfileMessage + ); + + childWindow.Title = Strings.DeleteAWSProfile; + + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } private async Task Configure() diff --git a/Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs b/Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs index 8ef01da9d7..fe3106065c 100644 --- a/Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs @@ -251,7 +251,7 @@ private void LookupProfileAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.DNSLookup) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.DNSLookup) .ConfigureAwait(false); } @@ -264,14 +264,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -279,7 +279,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs b/Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs index d7634f1267..defa8b9d6e 100644 --- a/Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs @@ -10,8 +10,10 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; +using MahApps.Metro.SimpleChildWindow; namespace NETworkManager.ViewModels; @@ -41,8 +43,11 @@ public DNSServerConnectionInfoProfile SelectedDNSServer } } - private List ServerInfoProfileNames => [.. SettingsManager.Current.DNSLookup_DNSServers - .Where(x => !x.UseWindowsDNSServer).Select(x => x.Name)]; + private List ServerInfoProfileNames => + [ + .. SettingsManager.Current.DNSLookup_DNSServers + .Where(x => !x.UseWindowsDNSServer).Select(x => x.Name) + ]; private bool _addDNSSuffix; @@ -154,10 +159,10 @@ public QueryClass QueryClass } } - /* + /* * Disabled until more query types are implemented. - * - + * + private bool _showOnlyMostCommonQueryTypes; public bool ShowOnlyMostCommonQueryTypes @@ -352,27 +357,31 @@ public async Task EditDNSServer() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async Task DeleteDNSServer() + private Task DeleteDNSServer() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteDNSServer - }; + var childWindow = new OKCancelInfoMessageChildWindow(); - var viewModel = new ConfirmDeleteViewModel(_ => + var childWindowViewModel = new OKCancelInfoMessageViewModel(_ => { - _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.DNSLookup_DNSServers.Remove(SelectedDNSServer); - }, _ => { _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, - Strings.DeleteDNSServerMessage); - - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = viewModel - }; - - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + }, _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, + Strings.DeleteDNSServerMessage + ); + + childWindow.Title = Strings.DeleteDNSServer; + + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/ViewModels/IPGeolocationHostViewModel.cs b/Source/NETworkManager/ViewModels/IPGeolocationHostViewModel.cs index b0bb7f42eb..3cc8ded9ec 100644 --- a/Source/NETworkManager/ViewModels/IPGeolocationHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPGeolocationHostViewModel.cs @@ -252,7 +252,7 @@ private void QueryProfileAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.IPGeolocation) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.IPGeolocation) .ConfigureAwait(false); } @@ -265,14 +265,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -280,7 +280,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs b/Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs index a352707c3a..4eacaee941 100644 --- a/Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs @@ -251,7 +251,7 @@ private void ScanProfileAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.IPScanner) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.IPScanner) .ConfigureAwait(false); } @@ -264,14 +264,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -279,7 +279,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/IPScannerSettingsViewModel.cs b/Source/NETworkManager/ViewModels/IPScannerSettingsViewModel.cs index 3ab2ee132c..ca5ecf0796 100644 --- a/Source/NETworkManager/ViewModels/IPScannerSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPScannerSettingsViewModel.cs @@ -1,7 +1,10 @@ using System.ComponentModel; +using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Settings; using NETworkManager.Utilities; @@ -328,7 +331,7 @@ private void EditCustomCommandAction() private void DeleteCustomCommandAction() { - DeleteCustomCommand(); + DeleteCustomCommand().ConfigureAwait(false); } #endregion @@ -382,27 +385,31 @@ public async void EditCustomCommand() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async void DeleteCustomCommand() + private Task DeleteCustomCommand() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteCustomCommand - }; + var childWindow = new OKCancelInfoMessageChildWindow(); - var confirmDeleteViewModel = new ConfirmDeleteViewModel(_ => + var childWindowViewModel = new OKCancelInfoMessageViewModel(_ => { - _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.IPScanner_CustomCommands.Remove(SelectedCustomCommand); - }, _ => { _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, - Strings.DeleteCustomCommandMessage); + }, _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, + Strings.DeleteCustomCommandMessage + ); - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; + childWindow.Title = Strings.DeleteCustomCommand; - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/ViewModels/IPScannerViewModel.cs b/Source/NETworkManager/ViewModels/IPScannerViewModel.cs index a95b877b2e..affc75a685 100644 --- a/Source/NETworkManager/ViewModels/IPScannerViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPScannerViewModel.cs @@ -344,7 +344,7 @@ private async void AddProfileSelectedHostAction() var window = Application.Current.Windows.OfType().FirstOrDefault(x => x.IsActive); - await ProfileDialogManager.ShowAddProfileDialog(window, this, _dialogCoordinator, profileInfo, null, + await ProfileDialogManager.ShowAddProfileDialog(window, this, profileInfo, null, ApplicationName.IPScanner); } diff --git a/Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs b/Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs index f11c4ecf84..8722bc23e9 100644 --- a/Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs +++ b/Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs @@ -751,7 +751,7 @@ private void ApplyProfileProfileAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.NetworkInterface) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.NetworkInterface) .ConfigureAwait(false); } @@ -764,14 +764,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -779,7 +779,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/ConfirmDeleteViewModel.cs b/Source/NETworkManager/ViewModels/OKCancelInfoMessageViewModel.cs similarity index 74% rename from Source/NETworkManager/ViewModels/ConfirmDeleteViewModel.cs rename to Source/NETworkManager/ViewModels/OKCancelInfoMessageViewModel.cs index 3c481d11da..a6ca63ab39 100644 --- a/Source/NETworkManager/ViewModels/ConfirmDeleteViewModel.cs +++ b/Source/NETworkManager/ViewModels/OKCancelInfoMessageViewModel.cs @@ -4,12 +4,12 @@ namespace NETworkManager.ViewModels; -public class ConfirmDeleteViewModel : ViewModelBase +public class OKCancelInfoMessageViewModel : ViewModelBase { private readonly string _message; - public ConfirmDeleteViewModel(Action deleteCommand, - Action cancelHandler, string message) + public OKCancelInfoMessageViewModel(Action deleteCommand, + Action cancelHandler, string message) { DeleteCommand = new RelayCommand(_ => deleteCommand(this)); CancelCommand = new RelayCommand(_ => cancelHandler(this)); diff --git a/Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs b/Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs index 413f213ebb..db7dad3d4a 100644 --- a/Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs @@ -357,7 +357,7 @@ private void ExportAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.PingMonitor) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.PingMonitor) .ConfigureAwait(false); } @@ -370,14 +370,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -385,7 +385,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs b/Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs index bac9aa7a66..2fe8789688 100644 --- a/Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs @@ -252,7 +252,7 @@ private void ScanProfileAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.PortScanner) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.PortScanner) .ConfigureAwait(false); } @@ -265,14 +265,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -280,7 +280,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/PortScannerSettingsViewModel.cs b/Source/NETworkManager/ViewModels/PortScannerSettingsViewModel.cs index 10819086ca..2ddb475149 100644 --- a/Source/NETworkManager/ViewModels/PortScannerSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/PortScannerSettingsViewModel.cs @@ -1,8 +1,10 @@ using System.ComponentModel; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Models.Network; using NETworkManager.Settings; @@ -230,27 +232,31 @@ public async Task EditPortProfile() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async Task DeletePortProfile() + private Task DeletePortProfile() { - var customDialog = new CustomDialog - { - Title = Strings.DeletePortProfile - }; + var childWindow = new OKCancelInfoMessageChildWindow(); - var confirmDeleteViewModel = new ConfirmDeleteViewModel(async _ => + var childWindowViewModel = new OKCancelInfoMessageViewModel(async _ => { - await _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.PortScanner_PortProfiles.Remove(SelectedPortProfile); - }, async _ => { await _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, - Strings.DeletePortProfileMessage); - - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; - - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + }, async _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, + Strings.DeletePortProfileMessage + ); + + childWindow.Title = Strings.DeletePortProfile; + + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs index 7165e98b05..458f9384f0 100644 --- a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs @@ -359,7 +359,7 @@ private void ConnectProfileExternalAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.PowerShell) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.PowerShell) .ConfigureAwait(false); } @@ -372,14 +372,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -387,7 +387,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/ProfilesViewModel.cs b/Source/NETworkManager/ViewModels/ProfilesViewModel.cs index e71def69ba..efb5deb5ba 100644 --- a/Source/NETworkManager/ViewModels/ProfilesViewModel.cs +++ b/Source/NETworkManager/ViewModels/ProfilesViewModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using System.Windows.Threading; @@ -165,7 +166,7 @@ public bool IsSearching private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, SelectedGroup?.Name) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, SelectedGroup?.Name) .ConfigureAwait(false); } @@ -178,7 +179,7 @@ private bool EditProfile_CanExecute(object parameter) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } private bool ModifyProfile_CanExecute(object obj) @@ -190,7 +191,7 @@ private bool ModifyProfile_CanExecute(object obj) private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -198,8 +199,8 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, - new List(SelectedProfiles.Cast())).ConfigureAwait(false); + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) + .ConfigureAwait(false); } public ICommand AddGroupCommand => new RelayCommand(_ => AddGroupAction()); @@ -220,7 +221,7 @@ private void EditGroupAction() private void DeleteGroupAction() { - ProfileDialogManager.ShowDeleteGroupDialog(this, _dialogCoordinator, SelectedGroup).ConfigureAwait(false); + ProfileDialogManager.ShowDeleteGroupDialog(Application.Current.MainWindow, this, SelectedGroup).ConfigureAwait(false); } #endregion diff --git a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs index e560490cf1..948c06443c 100644 --- a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs @@ -366,7 +366,7 @@ private void ConnectProfileExternalAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.PuTTY) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.PuTTY) .ConfigureAwait(false); } @@ -379,14 +379,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -394,7 +394,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs b/Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs index 9995bbf22c..0235f55729 100644 --- a/Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs @@ -337,7 +337,7 @@ private void ConnectProfileExternalAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.RemoteDesktop) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.RemoteDesktop) .ConfigureAwait(false); } @@ -350,14 +350,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -365,7 +365,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/SNMPHostViewModel.cs b/Source/NETworkManager/ViewModels/SNMPHostViewModel.cs index d624478b5b..6c6ae13d3a 100644 --- a/Source/NETworkManager/ViewModels/SNMPHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/SNMPHostViewModel.cs @@ -249,7 +249,7 @@ private void AddTabProfileAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.SNMP) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.SNMP) .ConfigureAwait(false); } @@ -262,14 +262,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -277,7 +277,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/SNMPSettingsViewModel.cs b/Source/NETworkManager/ViewModels/SNMPSettingsViewModel.cs index 8f01f821d9..2ad88b2e84 100644 --- a/Source/NETworkManager/ViewModels/SNMPSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/SNMPSettingsViewModel.cs @@ -3,10 +3,12 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using Lextm.SharpSnmpLib.Messaging; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Models.Network; using NETworkManager.Settings; @@ -199,27 +201,31 @@ public async Task EditOIDProfile() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async Task DeleteOIDProfile() + private Task DeleteOIDProfile() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteOIDProfile - }; - - var confirmDeleteViewModel = new ConfirmDeleteViewModel(_ => + var childWindow = new OKCancelInfoMessageChildWindow(); + + var childWindowViewModel = new OKCancelInfoMessageViewModel(_ => { - _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.SNMP_OidProfiles.Remove(SelectedOIDProfile); - }, _ => { _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, - Strings.DeleteOIDProfileMessage); - - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; - - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + }, _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, + Strings.DeleteOIDProfileMessage + ); + + childWindow.Title = Strings.DeleteOIDProfile; + + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/ViewModels/SNTPLookupSettingsViewModel.cs b/Source/NETworkManager/ViewModels/SNTPLookupSettingsViewModel.cs index c702a79fe5..46a8e4ed4e 100644 --- a/Source/NETworkManager/ViewModels/SNTPLookupSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/SNTPLookupSettingsViewModel.cs @@ -2,9 +2,11 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Models.Network; using NETworkManager.Settings; @@ -183,27 +185,31 @@ public async Task EditServer() await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); } - private async Task DeleteServer() + private Task DeleteServer() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteSNTPServer - }; + var childWindow = new OKCancelInfoMessageChildWindow(); + - var viewModel = new ConfirmDeleteViewModel(_ => + var childWindowViewModel = new OKCancelInfoMessageViewModel(_ => { - _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; SettingsManager.Current.SNTPLookup_SNTPServers.Remove(SelectedSNTPServer); - }, _ => { _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, + }, _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, Strings.DeleteSNTPServerMessage); - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = viewModel - }; + childWindow.Title = Strings.DeleteSNTPServer; - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } #endregion diff --git a/Source/NETworkManager/ViewModels/SettingsProfilesViewModel.cs b/Source/NETworkManager/ViewModels/SettingsProfilesViewModel.cs index 6cb82e7a57..08314bc757 100644 --- a/Source/NETworkManager/ViewModels/SettingsProfilesViewModel.cs +++ b/Source/NETworkManager/ViewModels/SettingsProfilesViewModel.cs @@ -3,9 +3,12 @@ using System.Diagnostics; using System.Linq; using System.Security.Cryptography; +using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using System.Windows.Input; using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.SimpleChildWindow; using NETworkManager.Localization.Resources; using NETworkManager.Profiles; using NETworkManager.Settings; @@ -147,34 +150,37 @@ private async void EditProfileFileAction() } public ICommand DeleteProfileFileCommand => - new RelayCommand(_ => DeleteProfileFileAction(), DeleteProfileFile_CanExecute); + new RelayCommand(_ => DeleteProfileFileAction().ConfigureAwait(false), DeleteProfileFile_CanExecute); private bool DeleteProfileFile_CanExecute(object obj) { return ProfileFiles.Cast().Count() > 1; } - private async void DeleteProfileFileAction() + private Task DeleteProfileFileAction() { - var customDialog = new CustomDialog - { - Title = Strings.DeleteProfileFile - }; - - var confirmDeleteViewModel = new ConfirmDeleteViewModel(async _ => + var childWindow = new OKCancelInfoMessageChildWindow(); + + var childWindowViewModel = new OKCancelInfoMessageViewModel(async _ => { - await _dialogCoordinator.HideMetroDialogAsync(this, customDialog); + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; ProfileManager.DeleteProfileFile(SelectedProfileFile); - }, async _ => { await _dialogCoordinator.HideMetroDialogAsync(this, customDialog); }, + }, async _ => + { + childWindow.IsOpen = false; + ConfigurationManager.Current.IsChildWindowOpen = false; + }, Strings.DeleteProfileFileMessage); - customDialog.Content = new ConfirmDeleteDialog - { - DataContext = confirmDeleteViewModel - }; - - await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog); + childWindow.Title = Strings.DeleteProfileFile; + + childWindow.DataContext = childWindowViewModel; + + ConfigurationManager.Current.IsChildWindowOpen = true; + + return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow); } public ICommand EnableEncryptionCommand => new RelayCommand(_ => EnableEncryptionAction()); diff --git a/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs b/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs index 9240e006f6..9d060acc3d 100644 --- a/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs @@ -301,7 +301,7 @@ private void ConnectProfileExternalAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.TigerVNC) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.TigerVNC) .ConfigureAwait(false); } @@ -314,14 +314,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -329,7 +329,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/TracerouteHostViewModel.cs b/Source/NETworkManager/ViewModels/TracerouteHostViewModel.cs index dee7c15f94..7861a5985f 100644 --- a/Source/NETworkManager/ViewModels/TracerouteHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/TracerouteHostViewModel.cs @@ -252,7 +252,7 @@ private void TraceProfileAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.Traceroute) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.Traceroute) .ConfigureAwait(false); } @@ -265,14 +265,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -280,7 +280,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/WakeOnLANViewModel.cs b/Source/NETworkManager/ViewModels/WakeOnLANViewModel.cs index 03175c4d35..0e5a53a375 100644 --- a/Source/NETworkManager/ViewModels/WakeOnLANViewModel.cs +++ b/Source/NETworkManager/ViewModels/WakeOnLANViewModel.cs @@ -308,7 +308,7 @@ private void WakeUpProfileAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.WakeOnLAN) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.WakeOnLAN) .ConfigureAwait(false); } @@ -321,14 +321,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -336,7 +336,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/WebConsoleHostViewModel.cs b/Source/NETworkManager/ViewModels/WebConsoleHostViewModel.cs index 59dbf9c47e..a5071a1cbb 100644 --- a/Source/NETworkManager/ViewModels/WebConsoleHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/WebConsoleHostViewModel.cs @@ -299,7 +299,7 @@ private void ConnectProfileAction() private void AddProfileAction() { ProfileDialogManager - .ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.WebConsole) + .ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.WebConsole) .ConfigureAwait(false); } @@ -312,14 +312,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -327,7 +327,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/ViewModels/WhoisHostViewModel.cs b/Source/NETworkManager/ViewModels/WhoisHostViewModel.cs index 68351a70ef..40aef3e150 100644 --- a/Source/NETworkManager/ViewModels/WhoisHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/WhoisHostViewModel.cs @@ -251,7 +251,7 @@ private void QueryProfileAction() private void AddProfileAction() { - ProfileDialogManager.ShowAddProfileDialog(this, this, _dialogCoordinator, null, null, ApplicationName.Whois) + ProfileDialogManager.ShowAddProfileDialog(Application.Current.MainWindow, this, null, null, ApplicationName.Whois) .ConfigureAwait(false); } @@ -264,14 +264,14 @@ private bool ModifyProfile_CanExecute(object obj) private void EditProfileAction() { - ProfileDialogManager.ShowEditProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowEditProfileDialog(Application.Current.MainWindow, this, SelectedProfile).ConfigureAwait(false); } public ICommand CopyAsProfileCommand => new RelayCommand(_ => CopyAsProfileAction(), ModifyProfile_CanExecute); private void CopyAsProfileAction() { - ProfileDialogManager.ShowCopyAsProfileDialog(this, _dialogCoordinator, SelectedProfile).ConfigureAwait(false); + ProfileDialogManager.ShowCopyAsProfileDialog(Application.Current.MainWindow,this, SelectedProfile).ConfigureAwait(false); } public ICommand DeleteProfileCommand => new RelayCommand(_ => DeleteProfileAction(), ModifyProfile_CanExecute); @@ -279,7 +279,7 @@ private void CopyAsProfileAction() private void DeleteProfileAction() { ProfileDialogManager - .ShowDeleteProfileDialog(this, _dialogCoordinator, new List { SelectedProfile }) + .ShowDeleteProfileDialog(Application.Current.MainWindow, this, new List { SelectedProfile }) .ConfigureAwait(false); } diff --git a/Source/NETworkManager/Views/AWSSessionManagerSettingsView.xaml b/Source/NETworkManager/Views/AWSSessionManagerSettingsView.xaml index 82b2fd682d..10f3043c2d 100644 --- a/Source/NETworkManager/Views/AWSSessionManagerSettingsView.xaml +++ b/Source/NETworkManager/Views/AWSSessionManagerSettingsView.xaml @@ -85,94 +85,26 @@ - - - - - + diff --git a/Source/NETworkManager/Views/ConfirmDeleteDialog.xaml b/Source/NETworkManager/Views/ConfirmDeleteDialog.xaml deleted file mode 100644 index 170aa8c094..0000000000 --- a/Source/NETworkManager/Views/ConfirmDeleteDialog.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - + - - - - - + diff --git a/Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml b/Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml new file mode 100644 index 0000000000..1fd3d8456a --- /dev/null +++ b/Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + - - - + - - + xmlns:simpleChildWindow="clr-namespace:MahApps.Metro.SimpleChildWindow;assembly=MahApps.Metro.SimpleChildWindow" + ShowTitleBar="True" + TitleBarBackground="Transparent" + TitleBarNonActiveBackground="Transparent" + ShowCloseButton="True" + CloseButtonCommand="{Binding CancelCommand}" + AllowMove="True" + TitleForeground="{DynamicResource MahApps.Brushes.Gray3}" + CloseByEscape="False" + OverlayBrush="{DynamicResource ResourceKey=MahApps.Brushes.Gray.SemiTransparent}" + Loaded="UserControl_Loaded" + mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModels:ProfileViewModel}"> + + x:Key="RemoteDesktopAudioCaptureRedirectionModeToStringConverter" /> + x:Key="RemoteDesktopAudioRedirectionModeToStringConverter" /> + x:Key="RemoteDesktopKeyboardHookModeToStringConverter" /> + x:Key="RemoteDesktopGatewayServerLogonMethodToStringConverter" /> + x:Key="RemoteDesktopNetworkConnectionTypeToStringConverter" /> - - + x:Key="StringIsNotNullOrEmptyOrIPv4AddressToBooleanConverter" /> + + @@ -1148,82 +1158,82 @@ + Value="{Binding DataContext.NetworkInterface_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.IPScanner_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.PortScanner_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.PingMonitor_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.Traceroute_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.DNSLookup_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.RemoteDesktop_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.PowerShell_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.PuTTY_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.AWSSessionManager_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.TigerVNC_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.WebConsole_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.SNMP_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.WakeOnLAN_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.Whois_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> + Value="{Binding DataContext.IPGeolocation_Enabled, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type simpleChildWindow:ChildWindow}}}" /> @@ -4560,7 +4570,7 @@ - + @@ -4571,7 +4581,7 @@ - + @@ -4583,8 +4593,8 @@ - - + + @@ -4596,8 +4606,8 @@ - - + + @@ -4610,8 +4620,8 @@ - - - - - diff --git a/Source/NETworkManager/Views/SNMPSettingsView.xaml b/Source/NETworkManager/Views/SNMPSettingsView.xaml index ede5bec26f..4bc3abbcc5 100644 --- a/Source/NETworkManager/Views/SNMPSettingsView.xaml +++ b/Source/NETworkManager/Views/SNMPSettingsView.xaml @@ -76,94 +76,26 @@ - - - - - + - - - - - + diff --git a/Source/NETworkManager/Views/SettingsProfilesView.xaml b/Source/NETworkManager/Views/SettingsProfilesView.xaml index 11799a4b0f..5112afb2c9 100644 --- a/Source/NETworkManager/Views/SettingsProfilesView.xaml +++ b/Source/NETworkManager/Views/SettingsProfilesView.xaml @@ -144,95 +144,25 @@ - - - - - + \ No newline at end of file diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index ac3b8ecf77..0c4f69757f 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -40,6 +40,8 @@ Release date: **xx.xx.2025** ## Improvements - Redesign welcome dialog. [#3077](https://github.com/BornToBeRoot/NETworkManager/pull/3077) +- Redesign profile dialog. [#3087](https://github.com/BornToBeRoot/NETworkManager/pull/3087) +- Redesign confirm delete dialog. [#3087](https://github.com/BornToBeRoot/NETworkManager/pull/3087) - Add upgrade dialog when updating from a previous version. [#3077](https://github.com/BornToBeRoot/NETworkManager/pull/3077) **WiFi** @@ -80,6 +82,9 @@ Release date: **xx.xx.2025** ## Bugfixes +- Fixed an issue where the profile file could be overwritten when creating a new profile file with the same name, but with another case (`Profile` exists, but `profile` is created). [#3087](https://github.com/BornToBeRoot/NETworkManager/pull/3087) +- Fixed an application crash when a profile file is renamed to another case (e.g. `Profile` to `profile`) [#3087](https://github.com/BornToBeRoot/NETworkManager/pull/3087). + **Network Interface** - Re-select the network interface after a network change or configuration update. Thanks to [@Ghislain1](https://github.com/Ghislain1) [#3004](https://github.com/BornToBeRoot/NETworkManager/pull/3004) [#2962](https://github.com/BornToBeRoot/NETworkManager/pull/2962)