1- using MahApps . Metro . Controls . Dialogs ;
2- using NETworkManager . Profiles ;
1+ using NETworkManager . Profiles ;
32using NETworkManager . Settings ;
43using NETworkManager . Utilities ;
54using System ;
65using System . Collections ;
76using System . Collections . Generic ;
8- using System . Collections . ObjectModel ;
97using System . ComponentModel ;
108using System . Linq ;
119using System . Windows ;
@@ -19,10 +17,8 @@ public class ProfilesViewModel : ViewModelBase, IProfileManager
1917{
2018 #region Constructor
2119
22- public ProfilesViewModel ( IDialogCoordinator instance )
20+ public ProfilesViewModel ( )
2321 {
24- _dialogCoordinator = instance ;
25-
2622 SetGroupsView ( ) ;
2723
2824 ProfileManager . OnProfilesUpdated += ProfileManager_OnProfilesUpdated ;
@@ -34,8 +30,7 @@ public ProfilesViewModel(IDialogCoordinator instance)
3430 #endregion
3531
3632 #region Variables
37-
38- private readonly IDialogCoordinator _dialogCoordinator ;
33+
3934 private readonly DispatcherTimer _searchDispatcherTimer = new ( ) ;
4035
4136 private bool _isViewActive = true ;
@@ -159,69 +154,7 @@ public bool IsSearching
159154 }
160155 }
161156
162- private bool _profileFilterIsOpen ;
163-
164- public bool ProfileFilterIsOpen
165- {
166- get => _profileFilterIsOpen ;
167- set
168- {
169- if ( value == _profileFilterIsOpen )
170- return ;
171-
172- _profileFilterIsOpen = value ;
173- OnPropertyChanged ( ) ;
174- }
175- }
176-
177- public ICollectionView ProfileFilterTagsView { get ; set ; }
178-
179- public ObservableCollection < ProfileFilterTagsInfo > ProfileFilterTags { get ; set ; } = [ ] ;
180-
181- private bool _profileFilterTagsMatchAny = GlobalStaticConfiguration . Profile_TagsMatchAny ;
182-
183- public bool ProfileFilterTagsMatchAny
184- {
185- get => _profileFilterTagsMatchAny ;
186- set
187- {
188- if ( value == _profileFilterTagsMatchAny )
189- return ;
190-
191- _profileFilterTagsMatchAny = value ;
192- OnPropertyChanged ( ) ;
193- }
194- }
195-
196- private bool _profileFilterTagsMatchAll ;
197-
198- public bool ProfileFilterTagsMatchAll
199- {
200- get => _profileFilterTagsMatchAll ;
201- set
202- {
203- if ( value == _profileFilterTagsMatchAll )
204- return ;
205-
206- _profileFilterTagsMatchAll = value ;
207- OnPropertyChanged ( ) ;
208- }
209- }
210-
211- private bool _isProfileFilterSet ;
212-
213- public bool IsProfileFilterSet
214- {
215- get => _isProfileFilterSet ;
216- set
217- {
218- if ( value == _isProfileFilterSet )
219- return ;
220-
221- _isProfileFilterSet = value ;
222- OnPropertyChanged ( ) ;
223- }
224- }
157+
225158 #endregion
226159
227160 #region Commands & Actions
@@ -287,37 +220,7 @@ private void DeleteGroupAction()
287220 {
288221 ProfileDialogManager . ShowDeleteGroupDialog ( Application . Current . MainWindow , this , SelectedGroup ) . ConfigureAwait ( false ) ;
289222 }
290-
291- public ICommand OpenProfileFilterCommand => new RelayCommand ( _ => OpenProfileFilterAction ( ) ) ;
292-
293- private void OpenProfileFilterAction ( )
294- {
295- ProfileFilterIsOpen = true ;
296- }
297-
298- public ICommand ApplyProfileFilterCommand => new RelayCommand ( _ => ApplyProfileFilterAction ( ) ) ;
299-
300- private void ApplyProfileFilterAction ( )
301- {
302- RefreshProfiles ( ) ;
303-
304- IsProfileFilterSet = true ;
305- ProfileFilterIsOpen = false ;
306- }
307-
308- public ICommand ClearProfileFilterCommand => new RelayCommand ( _ => ClearProfileFilterAction ( ) ) ;
309-
310- private void ClearProfileFilterAction ( )
311- {
312- foreach ( var tag in ProfileFilterTags )
313- tag . IsSelected = false ;
314-
315- RefreshProfiles ( ) ;
316-
317- IsProfileFilterSet = false ;
318- ProfileFilterIsOpen = false ;
319- }
320-
223+
321224 #endregion
322225
323226 #region Methods
0 commit comments