| title |
ChoiceSetSetting Class |
| description |
The ChoiceSetSetting class represents a setting that allows users to select from a predefined set of choices. |
| ms.date |
2/27/2025 |
| ms.topic |
reference |
| no-loc |
PowerToys |
Windows |
Insider |
|
Namespace: Microsoft.CommandPalette.Extensions.Toolkit
Inherits Setting<String>
The ChoiceSetSetting class represents a setting that allows users to select from a predefined set of choices. This is useful for applications that need to provide users with a limited set of options to choose from, such as selecting a theme or a configuration option.
| Class |
Description |
| Choice |
Represents a single choice in the choice set. Each choice has a name and a value. The name is displayed to the user, while the value is used internally by the application. |
| Property |
Type |
Description |
| Choices |
List<Choice> |
Gets or sets the list of choices available in the choice set. Each choice is represented by an instance of the Choice class. |
| Method |
Description |
| LoadFromJson(JsonObject) |
Loads the setting from a JSON object. This is useful for applications that need to deserialize settings from a configuration file or other JSON source. |
| ToDictionary() |
Converts the setting to a dictionary representation. This is useful for applications that need to serialize settings to a format that can be easily stored or transmitted. |
| ToState() |
Converts the setting to a state representation. This is useful for applications that need to represent settings in a format that can be easily displayed or manipulated. |
| Update(JsonObject) |
Updates the setting from a JSON object. This is useful for applications that need to apply changes to settings based on user input or other sources. |