Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WinUIGallery/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</toolkit:SettingsExpander.Items>
</toolkit:SettingsExpander>

<toolkit:SettingsExpander x:Name="ScreenshotCard" Header="Screenshot mode">
<toolkit:SettingsExpander x:Name="ScreenshotCard" Header="Screenshot mode" Visibility="Collapsed">
<toolkit:SettingsExpander.HeaderIcon>
<FontIcon Glyph="&#xEC4F;" />
</toolkit:SettingsExpander.HeaderIcon>
Expand Down
27 changes: 18 additions & 9 deletions WinUIGallery/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,12 @@ public string Version
}

public string WinAppSdkRuntimeDetails => App.WinAppSdkRuntimeDetails;
private int lastNavigationSelectionMode = 0;

public SettingsPage()
{
this.InitializeComponent();
Loaded += OnSettingsPageLoaded;

if (ElementSoundPlayer.State == ElementSoundPlayerState.On)
soundToggle.IsOn = true;
if (ElementSoundPlayer.SpatialAudioMode == ElementSpatialAudioMode.On)
spatialSoundBox.IsOn = true;

ScreenshotCard.Visibility = Visibility.Collapsed;
}

protected override void OnNavigatedTo(NavigationEventArgs e)
Expand Down Expand Up @@ -81,7 +75,16 @@ private void OnSettingsPageLoaded(object sender, RoutedEventArgs e)
{
navigationLocation.SelectedIndex = 1;
}
}
lastNavigationSelectionMode = navigationLocation.SelectedIndex;
}

if (ElementSoundPlayer.State == ElementSoundPlayerState.On)
soundToggle.IsOn = true;
if (ElementSoundPlayer.SpatialAudioMode == ElementSpatialAudioMode.On)
spatialSoundBox.IsOn = true;
#if DEBUG
ScreenshotCard.Visibility = Visibility.Visible;
#endif
}

private void themeMode_SelectionChanged(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -137,7 +140,13 @@ private void screenshotModeToggle_Toggled(object sender, RoutedEventArgs e)

private void navigationLocation_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
NavigationOrientationHelper.IsLeftModeForElement(navigationLocation.SelectedIndex == 0, this);
// Since setting the left mode does not look at the old setting we
// need to check if this is an actual update
if (navigationLocation.SelectedIndex != lastNavigationSelectionMode)
{
NavigationOrientationHelper.IsLeftModeForElement(navigationLocation.SelectedIndex == 0, this);
lastNavigationSelectionMode = navigationLocation.SelectedIndex;
}
}

private async void FolderButton_Click(object sender, RoutedEventArgs e)
Expand Down