terminal/src/cascadia
Leonard Hecker 35ce8cc858
Fix default terminal setting dropdown (#11430)
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` ✔️
2021-10-06 16:58:09 +00:00
..
CascadiaPackage Enable DefApp hooks for stable (#11423) 2021-10-06 11:32:14 +00:00
inc Only access ControlInteractivity through the projection (#10051) 2021-07-19 11:59:30 -05:00
LocalTests_SettingsModel Fix failing TestHostApp unit tests (#11394) 2021-10-05 18:21:03 +00:00
LocalTests_TerminalApp Fix failing TestHostApp unit tests (#11394) 2021-10-05 18:21:03 +00:00
PublicTerminalCore Implement Keyboard Selection (#10824) 2021-09-23 12:24:32 -07:00
Remoting Persist window layout cont. save multiple windows (#11083) 2021-09-27 21:18:39 +00:00
ShellExtension Properly escape constructed wt command-lines (#11314) 2021-09-24 16:17:16 +00:00
TerminalApp Center-align the shield with the other tab row icons (#11441) 2021-10-06 16:55:55 +00:00
TerminalAzBridge Upgrade to C++/WinRT 2.0.210825.3 (#11188) 2021-09-10 21:33:13 +00:00
TerminalConnection Change exit code to hex; Fix format spec (#11123) 2021-09-21 15:47:17 +00:00
TerminalControl Always init the BG opacity with the renderer (#11368) 2021-09-29 21:55:44 +00:00
TerminalCore [deadlock fix] Remove lock for SIUP::GetSelectionRange() (#11386) 2021-09-30 22:15:20 +00:00
TerminalSettingsEditor Fix crash and empty action in SUI Actions Page (#11427) 2021-10-06 11:33:05 +00:00
TerminalSettingsModel Fix default terminal setting dropdown (#11430) 2021-10-06 16:58:09 +00:00
UnitTests_Control Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
UnitTests_Remoting Persist window layout cont. save multiple windows (#11083) 2021-09-27 21:18:39 +00:00
UnitTests_TerminalCore Implement Keyboard Selection (#10824) 2021-09-23 12:24:32 -07:00
ut_app Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
WindowsTerminal Refresh frame margins when moving between monitors (#11412) 2021-10-06 11:34:53 +00:00
WindowsTerminal_UIATests Enable /Zc:preprocessor (#10593) 2021-07-13 23:00:11 +00:00
WindowsTerminalUniversal Update to MUX 2.7 (#11240) 2021-09-20 22:08:55 +00:00
WinRTUtils Replace the UWP file export with the shell32 one (#11365) 2021-10-01 18:33:22 +00:00
WpfTerminalControl wpf: make sure to pack api-ms-win-core-synch-l1-2-0 (#10587) 2021-07-08 10:31:59 -05:00
WpfTerminalTestNetCore wpf: make sure to pack api-ms-win-core-synch-l1-2-0 (#10587) 2021-07-08 10:31:59 -05:00
wt Upgrade Windows SDK to 19041 (#10118) 2021-05-20 16:04:25 +00:00
CascadiaResources.build.items Update Cascadia Code to 2106.17 (#10455) 2021-06-18 20:47:19 +00:00