UISettings 클래스

정의

일반적인 앱 사용자 인터페이스 설정 및 작업 집합을 포함합니다.

public ref class UISettings sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UISettings final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class UISettings final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UISettings
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class UISettings
function UISettings()
Public NotInheritable Class UISettings
상속
Object Platform::Object IInspectable UISettings
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

void MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
    Windows::UI::ViewManagement::UISettings uiSettings;

    std::wstringstream buffer;
    Windows::UI::Color color{ uiSettings.UIElementColor(UIElementType::ActiveCaption) };

    buffer << L"Hand Preference " << (uiSettings.HandPreference() == HandPreference::RightHanded ? L"right" : L"left") << std::endl;
    buffer << L"Cursor Size " << uiSettings.CursorSize().Width << L" x " << uiSettings.CursorSize().Height << std::endl;
    buffer << L"Scrollbar Size " << uiSettings.ScrollBarSize().Width << L" x " << uiSettings.ScrollBarSize().Height << std::endl;
    buffer << L"Scrollbar Arrow Size " << uiSettings.ScrollBarArrowSize().Width << L" x " << uiSettings.ScrollBarArrowSize().Height << std::endl;
    buffer << L"Scrollbar Thumb Box Size " << uiSettings.ScrollBarThumbBoxSize().Width << L" x " << uiSettings.ScrollBarThumbBoxSize().Height << std::endl;
    buffer << L"Message Duration " << uiSettings.MessageDuration() << std::endl;
    buffer << L"Animations Enabled " << (uiSettings.AnimationsEnabled() ? L"true" : L"false") << std::endl;
    buffer << L"Caret Browsing Enabled " << (uiSettings.CaretBrowsingEnabled() ? L"true" : L"false") << std::endl;
    buffer << L"Caret Blink Rate " << uiSettings.CaretBlinkRate() << std::endl;
    buffer << L"Caret Width " << uiSettings.CaretWidth() << std::endl;
    buffer << L"Double Click Time " << uiSettings.DoubleClickTime() << std::endl;
    buffer << L"Mouse Hover Time " << uiSettings.MouseHoverTime() << std::endl;

    buffer << L"System Colors: " << std::endl;

    buffer << L"Active Caption: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::Background);
    buffer << L"Background: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::ButtonFace);
    buffer << L"Button Face: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::ButtonText);
    buffer << L"Button Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::CaptionText);
    buffer << L"Caption Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::GrayText);
    buffer << L"Gray Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::Highlight);
    buffer << L"Highlight: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::HighlightText);
    buffer << L"Highlight Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::Hotlight);
    buffer << L"Hotlight: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::InactiveCaption);
    buffer << L"Inactive Caption: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::InactiveCaptionText);
    buffer << L"Inactive Caption Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::Window);
    buffer << L"Window: " << color.R << L", " << color.G << L", " << color.B << std::endl;
    color = uiSettings.UIElementColor(UIElementType::WindowText);
    buffer << L"Window Text: " << color.R << L", " << color.G << L", " << color.B << std::endl;

    UIOutputTextBlock().Text(buffer.str().c_str());
}
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;
  }
}

설명

버전 기록

Windows 버전 SDK 버전 추가된 값
1703 15063 AdvancedEffectsEnabled
1703 15063 AdvancedEffectsEnabledChanged
1903 18362 AutoHideScrollBars
1903 18362 AutoHideScrollBarsChanged
2004 19041 AnimationsEnabledChanged
2004 19041 MessageDurationChanged

생성자

UISettings()

UISettings 클래스의 새 기본 instance 만듭니다.

속성

AdvancedEffectsEnabled

시스템 투명도 효과 설정을 사용할 수 있는지 여부를 나타내는 값을 가져옵니다.

AnimationsEnabled

사용자 인터페이스에 애니메이션을 사용할 수 있는지 여부를 가져옵니다.

AutoHideScrollBars

사용자가 상호 작용하지 않을 때 스크롤 막대를 자동으로 숨기라고 지정했는지 여부를 가져옵니다.

CaretBlinkRate

앱 보기에서 만든 새 caret의 깜박임 속도를 가져옵니다.

CaretBrowsingEnabled

캐럿을 찾아보기 작업에 사용할 수 있는지 여부를 가져옵니다.

CaretWidth

앱 보기에서 만든 새 caret의 너비를 가져옵니다.

CursorSize

앱 보기에서 만든 새 커서의 크기를 가져옵니다.

DoubleClickTime

두 번 클릭 작업에서 클릭 사이에 허용되는 최대 시간을 가져옵니다.

HandPreference

앱 보기에서 만든 사용자 인터페이스의 방향 기본 설정을 가져옵니다.

MessageDuration

앱 보기에 대한 메시지가 표시되는 기간을 가져옵니다.

MouseHoverTime

마우스 포인터가 가리키기 이벤트가 발생하기 전에 마우스 포인터가 마우스 사각형에 놓일 수 있는 시간을 가져옵니다.

ScrollBarArrowSize

앱 보기와 연결된 창의 스크롤 막대 화살표 크기를 가져옵니다.

ScrollBarSize

앱 보기와 연결된 창의 스크롤 막대 크기를 가져옵니다.

ScrollBarThumbBoxSize

앱 보기와 연결된 창에 대한 엄지 상자의 크기를 가져옵니다.

TextScaleFactor

시스템 텍스트 크기 설정의 값을 가져옵니다.

메서드

GetColorValue(UIColorType)

지정한 색 형식의 색 값을 반환합니다.

UIElementColor(UIElementType)

단추 얼굴 또는 창 텍스트와 같은 특정 사용자 인터페이스 요소 형식에 사용되는 색을 가져옵니다.

이벤트

AdvancedEffectsEnabledChanged

시스템 고급 UI 효과 설정을 사용하거나 사용하지 않도록 설정할 때 발생합니다.

AnimationsEnabledChanged

AnimationsEnabled 속성의 값이 변경된 경우에 발생합니다.

AutoHideScrollBarsChanged

AutoHideScrollBars 상태가 변경될 때 호출되는 이벤트입니다.

ColorValuesChanged

색 값이 변경되었을 때 발생합니다.

MessageDurationChanged

MessageDuration 속성의 값이 변경된 경우에 발생합니다.

TextScaleFactorChanged

시스템 텍스트 크기 설정이 변경되면 발생합니다.

적용 대상

추가 정보