Skip to content

Commit 5316f7a

Browse files
committed
Fix: ProfileFilterPopup with focus window
1 parent fa22b5e commit 5316f7a

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ public ICommand TextBoxSearchLostFocusCommand
599599

600600
private void OpenProfileFilterAction()
601601
{
602+
ConfigurationManager.Current.IsProfileFilterPopupOpen = true;
603+
602604
ProfileFilterIsOpen = true;
603605
}
604606

@@ -1183,6 +1185,11 @@ private void RefreshProfiles()
11831185
IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any();
11841186
}
11851187

1188+
public void OnProfileFilterClosed()
1189+
{
1190+
ConfigurationManager.Current.IsProfileFilterPopupOpen = false;
1191+
}
1192+
11861193
public void OnProfileManagerDialogOpen()
11871194
{
11881195
ConfigurationManager.OnDialogOpen();

Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ public ICommand TextBoxSearchLostFocusCommand
503503

504504
private void OpenProfileFilterAction()
505505
{
506+
ConfigurationManager.Current.IsProfileFilterPopupOpen = true;
507+
506508
ProfileFilterIsOpen = true;
507509
}
508510

@@ -901,6 +903,11 @@ private void RefreshProfiles()
901903
IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any();
902904
}
903905

906+
public void OnProfileFilterClosed()
907+
{
908+
ConfigurationManager.Current.IsProfileFilterPopupOpen = false;
909+
}
910+
904911
public void OnProfileManagerDialogOpen()
905912
{
906913
ConfigurationManager.OnDialogOpen();

Source/NETworkManager/Views/AWSSessionManagerHostView.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@
402402
</Button>
403403
<Popup PlacementTarget="{Binding ElementName=ButtonProfileFilter}"
404404
Placement="Bottom" StaysOpen="False"
405+
Closed="PopupProfileFilter_Closed"
405406
IsOpen="{Binding ProfileFilterIsOpen}"
406407
Width="220">
407408
<Border Background="{DynamicResource MahApps.Brushes.Window.Background}"

Source/NETworkManager/Views/AWSSessionManagerHostView.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows;
1+
using System;
2+
using System.Windows;
23
using System.Windows.Controls;
34
using System.Windows.Input;
45
using MahApps.Metro.Controls.Dialogs;
@@ -54,4 +55,9 @@ public void FocusEmbeddedWindow()
5455
{
5556
_viewModel.FocusEmbeddedWindow();
5657
}
58+
59+
private void PopupProfileFilter_Closed(object sender, EventArgs e)
60+
{
61+
_viewModel.OnProfileFilterClosed();
62+
}
5763
}

Source/NETworkManager/Views/PuTTYHostView.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
</Button>
374374
<Popup PlacementTarget="{Binding ElementName=ButtonProfileFilter}"
375375
Placement="Bottom" StaysOpen="False"
376+
Closed="PopupProfileFilter_Closed"
376377
IsOpen="{Binding ProfileFilterIsOpen}"
377378
Width="220">
378379
<Border Background="{DynamicResource MahApps.Brushes.Window.Background}"

Source/NETworkManager/Views/PuTTYHostView.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading.Tasks;
1+
using System;
2+
using System.Threading.Tasks;
23
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Input;
@@ -61,4 +62,9 @@ public void FocusEmbeddedWindow()
6162
{
6263
_viewModel.FocusEmbeddedWindow();
6364
}
65+
66+
private void PopupProfileFilter_Closed(object sender, EventArgs e)
67+
{
68+
_viewModel.OnProfileFilterClosed();
69+
}
6470
}

0 commit comments

Comments
 (0)