ClosedCaptionTheme Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a closed caption theme, providing access to the display name, unique identifier, and formatting settings for the theme. Use the static methods of this class to get available themes, get or set the selected theme, and subscribe to theme change notifications.
public ref class ClosedCaptionTheme sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 983040)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ClosedCaptionTheme final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 983040)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ClosedCaptionTheme
Public NotInheritable Class ClosedCaptionTheme
- Inheritance
- Attributes
Windows requirements
| Requirements | Description |
|---|---|
| Device family |
Windows 11, version 24H2 (introduced in 10.0.26100.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v19.0)
|
Remarks
A ClosedCaptionTheme object is a snapshot of a theme's settings at the time it was retrieved. The object is not updated if the user modifies the theme through the Windows Settings app. Use the ThemesChanged and SelectedThemeChanged events to detect changes and retrieve updated theme data.
Setting a theme through TrySetSelectedTheme changes the system-wide closed caption theme for the current user, affecting all applications that render closed captions.
Properties
| Name | Description |
|---|---|
| BackgroundColor |
Gets the background color for the theme. |
| BackgroundOpacity |
Gets the background opacity for the theme. |
| ComputedBackgroundColor |
Gets the computed background color for the theme. |
| ComputedFontColor |
Gets the computed font color for the theme. |
| ComputedRegionColor |
Gets the computed region color for the theme. |
| DisplayName |
Gets the display name of the theme. |
| FontColor |
Gets the font color for the theme. |
| FontEffect |
Gets the font effect for the theme. |
| FontOpacity |
Gets the font opacity for the theme. |
| FontSize |
Gets the font size for the theme. |
| FontStyle |
Gets the font style for the theme. |
| Id |
Gets the unique identifier for the theme. |
| RegionColor |
Gets the region color for the theme. |
| RegionOpacity |
Gets the region opacity for the theme. |
Methods
| Name | Description |
|---|---|
| GetAvailableThemes() |
Gets the available closed caption themes. |
| GetSelectedTheme() |
Gets the currently selected closed caption theme. |
| TrySetSelectedTheme(ClosedCaptionTheme) |
Sets the specified theme as the currently selected closed caption theme for the current user. |
Events
| Name | Description |
|---|---|
| SelectedThemeChanged |
Occurs when the selected closed caption theme changes, or when the settings of the currently selected theme are modified. |
| ThemesChanged |
Occurs when the list of available closed caption themes changes. This includes when a theme is added, removed, or when a theme's settings are modified. |