35ce8cc858
WinUI/XAML requires the `SelectedItem` to be member of the list of `ItemsSource`. `CascadiaSettings::DefaultTerminals()` is such an `ItemsSource` and is called every time the launch settings page is visited. It calls `DefaultTerminal::Available()` which in turn calls `Refresh()`. While the `SelectedItem` was cached in `CascadiaSettings`, the value of `DefaultTerminals()` wasn't. Thus every time the page was visited, it refreshed the `ItemsSource` list without invalidating the current `SelectedItem`. This commit prevents such accidental mishaps from occurring in the future, by moving the responsibility of caching solely to the `CascadiaSettings` class. ## PR Checklist * [x] Closes #11424 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Navigating between SUI pages maintains the current dropdown selection ✔️ * Saving the settings saves the correct terminal at `HKCU:\Console\%%Startup` ✔️ |
||
---|---|---|
.. | ||
CascadiaPackage | ||
inc | ||
LocalTests_SettingsModel | ||
LocalTests_TerminalApp | ||
PublicTerminalCore | ||
Remoting | ||
ShellExtension | ||
TerminalApp | ||
TerminalAzBridge | ||
TerminalConnection | ||
TerminalControl | ||
TerminalCore | ||
TerminalSettingsEditor | ||
TerminalSettingsModel | ||
UnitTests_Control | ||
UnitTests_Remoting | ||
UnitTests_TerminalCore | ||
ut_app | ||
WindowsTerminal | ||
WindowsTerminal_UIATests | ||
WindowsTerminalUniversal | ||
WinRTUtils | ||
WpfTerminalControl | ||
WpfTerminalTestNetCore | ||
wt | ||
CascadiaResources.build.items |