Skip to content

Commit db047ef

Browse files
committed
Added the possibility to refresh WiFi passwords (#671)
1 parent 5161a75 commit db047ef

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

InternetTest/InternetTest/ViewModels/WiFiPageViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public ObservableCollection<NetworkAdapterItemViewModel> Adapters
6363

6464
public ICommand RefreshCommand => new RelayCommand(o => GetAdapters());
6565
public ICommand RefreshWiFiCommand { get; set; }
66+
public ICommand RefreshProfilesCommand => new RelayCommand(o => RefreshProfiles(true));
67+
6668
public WiFiPageViewModel(Settings settings)
6769
{
6870
_settings = settings;
@@ -112,10 +114,10 @@ internal void GetAdapters()
112114
}
113115
}
114116

115-
private async void RefreshProfiles()
117+
private async void RefreshProfiles(bool forceRefresh = false)
116118
{
117119
ProfileLoading = true;
118-
var profiles = await WlanProfile.GetProfilesAsync();
120+
var profiles = await WlanProfile.GetProfilesAsync(forceRefresh);
119121
WlanProfiles.Clear();
120122
profiles.ForEach(x => WlanProfiles.Add(new WlanProfileItemViewModel(x)));
121123
ProfileLoading = false;

InternetTest/InternetTest/Views/WiFiPage.xaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,22 @@
195195
Text="{x:Static lang:Resources.NoNetworks}"
196196
TextWrapping="Wrap" />
197197
</StackPanel>
198+
199+
<StackPanel Grid.Column="1" Orientation="Horizontal">
200+
<Button
201+
Padding="5"
202+
VerticalAlignment="Center"
203+
Background="Transparent"
204+
Command="{Binding RefreshProfilesCommand}"
205+
Content="&#xF191;"
206+
Cursor="Hand"
207+
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
208+
Foreground="{DynamicResource Foreground1}">
209+
<Button.ToolTip>
210+
<ToolTip Content="{x:Static lang:Resources.Refresh}" />
211+
</Button.ToolTip>
212+
</Button>
213+
</StackPanel>
198214
</Grid>
199215
</Border>
200216
<Border

0 commit comments

Comments
 (0)