UISettings, classe

UISettings Class

Contient un jeu de paramètres et d'opérations courants de l'interface utilisateur de l'application.

Syntaxe


var uiSettings = new Windows.UI.ViewManagement.UISettings();

Attributs

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Membres

UISettingsClasse possède ces types de membres :

Constructeurs

UISettingsClasse possède ces constructeurs.

ConstructeurDescription
UISettings Creates a new default instance of the UISettings class.

 

Méthodes

The UISettings Classe a les méthodes suivantes. Avec C#, Visual Basic et C++, elle hérite également des méthodes de Object Classe.

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

 

Propriétés

Le UISettingsClasse a les propriétés suivantes.

PropriétéType d'accèsDescription

AnimationsEnabled

En lecture seuleGets whether animations are enabled for the user interface.

CaretBlinkRate

En lecture seuleGets the blink rate of a new caret created by the app view.

CaretBrowsingEnabled

En lecture seuleGets whether the caret can be used for browse operations.

CaretWidth

En lecture seuleGets the width of a new caret created by the app view.

CursorSize

En lecture seuleGets the size of a new cursor created by the app view.

DoubleClickTime

En lecture seuleGets the maximum allowed time between clicks in a double-click operation.

HandPreference

En lecture seuleGets the directional preference of the user interface created by the app view.

MessageDuration

En lecture seuleGets the length of time a message is displayed for the app view.

MouseHoverTime

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

ScrollBarArrowSize

En lecture seuleGets the size of a scroll bar arrow for windows associated with the app view.

ScrollBarSize

En lecture seuleGets the size of a scroll bar for windows associated with the app view.

ScrollBarThumbBoxSize

En lecture seuleGets the size of a thumb box for windows associated with the app view.

 

Remarques


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;
  }
}

Conditions requises

Client minimal pris en charge

Windows 8 [Applications Windows Store uniquement]

Serveur minimal pris en charge

Windows Server 2012 [Applications Windows Store uniquement]

Téléphone minimal pris en charge

Windows Phone 8

Espace de noms

Windows.UI.ViewManagement
Windows::UI::ViewManagement [C++]

Métadonnées

Windows.winmd

Voir aussi

Exemple de contraste et de paramètres de l'interface utilisateur

 

 

Afficher:
© 2018 Microsoft