Skip to content

Commit

Permalink
Fix UI reload if settings controls not loaded (Fix #73)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabboxl committed Mar 24, 2024
1 parent 73d6824 commit c2b8bec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions FluentWeather/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@ private async void UnitsSegmented_OnSelectionChanged(object sender, SelectionCha
{
var segmented = (Segmented) sender;

if (!segmented.IsLoaded)
return;

//save selected index to local settings
await ApplicationData.Current.LocalSettings.SaveAsync("selectedUnits", segmented.SelectedIndex);

Expand Down Expand Up @@ -672,6 +675,9 @@ private async void TimeFormatSegmented_OnSelectionChanged(object sender, Selecti
{
var segmented = (Segmented) sender;

if (!segmented.IsLoaded)
return;

//save selected index to local settings
await ApplicationData.Current.LocalSettings.SaveAsync("is12HourFormat", segmented.SelectedIndex == 1);

Expand Down

0 comments on commit c2b8bec

Please # to comment.