Skip to content

Apply MVVM Pattern to Settings UI #9207

@carlos-zamora

Description

@carlos-zamora

The Settings UI is currently directly bound to the settings model. Unfortunately, this forces us to run into a few issues every now and then:

  • polluting the settings model with more XAML dependencies
  • inability to check if a value truly changed

The Model-View-ViewModel Design Pattern was designed to keep the settings model and the settings UI pure simultaneously.

We've already started some of this work by introducing the ProfileViewModel. It serves as a middle-man between the UI controls and the settings model, and can be used to track extra information like "is this the base layer" and special values for settings (i.e. background image's use desktop wallpaper, etc.).

We need to apply this design pattern to...

  • ColorSchemes
  • Global settings
  • CascadiaSettings

This allows for the following scenarios:

  • detect unsaved changes and display an appropriate warning label
  • only load font lists once, and share them across all ProfileViewModels and AppearanceViewModels
  • load the color schemes and be able to display a mini-grid of colors to display throughout the code (i.e. profile page)
  • load the key bindings upon initial SUI load asynchronously, then just pass that into the actions page for a huge performance boost

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsUIAnything specific to the SUIIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions