UISettings UISettings UISettings UISettings UISettings Class

Definition

Contains a set of common app user interface settings and operations.

public : sealed class UISettings : IUISettings, IUISettings2, IUISettings3, IUISettings4
struct winrt::Windows::UI::ViewManagement::UISettings : IUISettings, IUISettings2, IUISettings3, IUISettings4
public sealed class UISettings : IUISettings, IUISettings2, IUISettings3, IUISettings4
Public NotInheritable Class UISettings Implements IUISettings, IUISettings2, IUISettings3, IUISettings4
var uiSettings = new uiSettings();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

void SDKSample::HighContrast::UI::UIGetSettings_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{ 
  Button^ b = safe_cast<Button^>(sender);
  if (b != nullptr)
  {
    UISettings^ pUserSettings = ref new UISettings();
    Platform::String^ Buffer;
    Windows::UI::Color Color;

        Buffer =  "Hand Preference " + (pUserSettings->HandPreference == HandPreference::RightHanded ? "right" : "left") + "\n";
        Buffer += "Cursor Size "  + pUserSettings->CursorSize.Width.ToString() + " x " + pUserSettings->CursorSize.Height.ToString() + "\n";
        Buffer += "Scrollbar Size "  + pUserSettings->ScrollBarSize.Width.ToString() + " x " + pUserSettings->ScrollBarSize.Height.ToString() + "\n";
        Buffer += "Scrollbar Arrow Size "   + pUserSettings->ScrollBarArrowSize.Width.ToString() + " x " + pUserSettings->ScrollBarArrowSize.Height.ToString() + "\n";
        Buffer += "Scrollbar Thumb Box Size " + pUserSettings->ScrollBarThumbBoxSize.Width.ToString() + " x " + pUserSettings->ScrollBarThumbBoxSize.Height.ToString() + "\n";
        Buffer += "Message Duration "  + pUserSettings->MessageDuration.ToString() + "\n";
        Buffer += "Animations Enabled "  + (pUserSettings->AnimationsEnabled ? "true" : "false") + "\n"; 
        Buffer += "Caret Browsing Enabled "  + (pUserSettings->CaretBrowsingEnabled ? "true" : "false") + "\n";
        Buffer += "Caret Blink Rate "  + pUserSettings->CaretBlinkRate.ToString() + "\n";
        Buffer += "Caret Width " + pUserSettings->CaretWidth.ToString() + "\n";
        Buffer += "Double Click Time " + pUserSettings->DoubleClickTime.ToString() + "\n";
        Buffer += "Mouse Hover Time " + pUserSettings->MouseHoverTime.ToString() + "\n";

        Buffer += "System Colors: \n";

        Color = pUserSettings->UIElementColor(UIElementType::ActiveCaption);
        Buffer += "Active Caption: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::Background);
        Buffer += "Background: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::ButtonFace);
        Buffer += "Button Face: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::ButtonText);
        Buffer += "Button Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::CaptionText);
        Buffer += "Caption Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::GrayText);
        Buffer += "Gray Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::Highlight);
        Buffer += "Highlight: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::HighlightText);
        Buffer += "Highlight Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::Hotlight);
        Buffer += "Hotlight: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::InactiveCaption);
        Buffer += "Inactive Caption: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::InactiveCaptionText);
        Buffer += "Inactive Caption Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::Window);
        Buffer += "Window: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";
        Color = pUserSettings->UIElementColor(UIElementType::WindowText);
        Buffer += "Window Text: " + Color.R.ToString() + ", " + Color.G.ToString() + ", " + Color.B.ToString() + "\n";

    UIOutputTextBlock->Text = Buffer;
  }
}

Constructors

UISettings() UISettings() UISettings() UISettings() UISettings()

Creates a new default instance of the UISettings class.

Properties

AdvancedEffectsEnabled AdvancedEffectsEnabled AdvancedEffectsEnabled AdvancedEffectsEnabled AdvancedEffectsEnabled

Gets a value that indicates whether the system Transparency effects setting is enabled.

AnimationsEnabled AnimationsEnabled AnimationsEnabled AnimationsEnabled AnimationsEnabled

Gets whether animations are enabled for the user interface.

CaretBlinkRate CaretBlinkRate CaretBlinkRate CaretBlinkRate CaretBlinkRate

Gets the blink rate of a new caret created by the app view.

CaretBrowsingEnabled CaretBrowsingEnabled CaretBrowsingEnabled CaretBrowsingEnabled CaretBrowsingEnabled

Gets whether the caret can be used for browse operations.

CaretWidth CaretWidth CaretWidth CaretWidth CaretWidth

Gets the width of a new caret created by the app view.

CursorSize CursorSize CursorSize CursorSize CursorSize

Gets the size of a new cursor created by the app view.

DoubleClickTime DoubleClickTime DoubleClickTime DoubleClickTime DoubleClickTime

Gets the maximum allowed time between clicks in a double-click operation.

HandPreference HandPreference HandPreference HandPreference HandPreference

Gets the directional preference of the user interface created by the app view.

MessageDuration MessageDuration MessageDuration MessageDuration MessageDuration

Gets the length of time a message is displayed for the app view.

MouseHoverTime MouseHoverTime MouseHoverTime MouseHoverTime MouseHoverTime

Gets the amount of time the mouse pointer can rest in a hover rectangle before a hover event is raised.

ScrollBarArrowSize ScrollBarArrowSize ScrollBarArrowSize ScrollBarArrowSize ScrollBarArrowSize

Gets the size of a scroll bar arrow for windows associated with the app view.

ScrollBarSize ScrollBarSize ScrollBarSize ScrollBarSize ScrollBarSize

Gets the size of a scroll bar for windows associated with the app view.

ScrollBarThumbBoxSize ScrollBarThumbBoxSize ScrollBarThumbBoxSize ScrollBarThumbBoxSize ScrollBarThumbBoxSize

Gets the size of a thumb box for windows associated with the app view.

TextScaleFactor TextScaleFactor TextScaleFactor TextScaleFactor TextScaleFactor

Gets the value of the system text size setting.

Methods

GetColorValue(UIColorType) GetColorValue(UIColorType) GetColorValue(UIColorType) GetColorValue(UIColorType) GetColorValue(UIColorType)

Returns the color value of the specified color type.

UIElementColor(UIElementType) UIElementColor(UIElementType) UIElementColor(UIElementType) UIElementColor(UIElementType) UIElementColor(UIElementType)

Gets the color used for a specific user interface element type, such as a button face or window text.

Events

AdvancedEffectsEnabledChanged AdvancedEffectsEnabledChanged AdvancedEffectsEnabledChanged AdvancedEffectsEnabledChanged AdvancedEffectsEnabledChanged

Occurs when the system advanced UI effects setting is enabled or disabled.

ColorValuesChanged ColorValuesChanged ColorValuesChanged ColorValuesChanged ColorValuesChanged

Occurs when color values have changed.

TextScaleFactorChanged TextScaleFactorChanged TextScaleFactorChanged TextScaleFactorChanged TextScaleFactorChanged

Occurs when the system text size setting is changed.

See Also