SettingsPane 클래스

정의

참고

SettingsPane은 더 이상 사용되지 않으며 모든 버전의 Windows 10 작동하지 않을 수 있습니다. SettingsPane을 사용하는 대신 앱 환경에 설정 옵션을 통합합니다. 자세한 내용은 앱 설정에 대한 지침을 참조하세요.

앱이 설정 참 창을 제어할 수 있도록 하는 정적 클래스입니다. 앱은 명령을 추가하거나 제거하거나, 사용자가 창을 열 때 알림을 받거나, 프로그래밍 방식으로 창을 열 수 있습니다.

public ref class SettingsPane sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.ApplicationSettings.ApplicationsSettingsContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.UI.ApplicationSettings.ApplicationsSettingsContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
class SettingsPane final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.ApplicationSettings.ApplicationsSettingsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
/// [Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
class SettingsPane final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.ApplicationSettings.ApplicationsSettingsContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.UI.ApplicationSettings.ApplicationsSettingsContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
public sealed class SettingsPane
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.ApplicationSettings.ApplicationsSettingsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
[Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
public sealed class SettingsPane
Public NotInheritable Class SettingsPane
상속
Object Platform::Object IInspectable SettingsPane
특성

Windows 요구 사항

디바이스 패밀리
Windows Desktop Extension SDK (10.0.10240.0에서 도입되었습니다.)
Xbox One Extensions for the UWP (10.0.10586.0에서 도입되었습니다.)
API contract
Windows.UI.ApplicationSettings.ApplicationsSettingsContract (v1.0에서 도입되었습니다.)

예제

다음 코드에서는 SettingsPane 및 SettingsCommand 클래스를 사용하여 앱 명령을 추가하는 방법을 보여 줍니다. 전체 예제는 앱 설정 샘플을 참조하세요.

using Windows.UI.ApplicationSettings;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using System;

// This is the click handler for the 'addSettingsScenarioAdd' button.  
// Replace this with your own handler if you have a button or buttons on this page.
void addSettingsScenarioAdd_Click(object sender, RoutedEventArgs e)
{
    Button b = sender as Button;
    if (b != null)
    {
        rootPage.NotifyUser(
            "You selected the " + b.Content + " button", 
            NotifyType.StatusMessage);

        if (!this.isEventRegistered)
        {
            SettingsPane.GetForCurrentView().CommandsRequested += onCommandsRequested;
            this.isEventRegistered = true;
        }
    }
}

void onSettingsCommand(IUICommand command)
{
    SettingsCommand settingsCommand = (SettingsCommand)command;
    rootPage.NotifyUser(
        "You selected the " + settingsCommand.Label + " settings command from the " + 
        SettingsPane.Edge.ToString(), NotifyType.StatusMessage);

}

void onCommandsRequested(
    SettingsPane settingsPane, 
    SettingsPaneCommandsRequestedEventArgs eventArgs)
{
    UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);

    SettingsCommand generalCommand = new SettingsCommand(
        "generalSettings", "General", handler);
    eventArgs.Request.ApplicationCommands.Add(generalCommand);

    SettingsCommand helpCommand = new SettingsCommand("helpPage", "Help", handler);
    eventArgs.Request.ApplicationCommands.Add(helpCommand);
}
Imports Windows.UI.ApplicationSettings
Imports Windows.UI.Popups
Imports Windows.UI.Xaml
Imports Windows.UI.Xaml.Controls
Imports Windows.UI.Xaml.Navigation
Imports System

    '' This is the click handler for the 'addSettingsScenarioAdd' button.  
    '' Replace this with your own handler if you have a button or buttons on this page.
    Private Sub addSettingsScenarioAdd_Click(sender As Object, e As RoutedEventArgs)
        Dim b As Button = TryCast(sender, Button)
        If b IsNot Nothing Then
            rootPage.NotifyUser("You selected the " & b.Content & " button", _
                NotifyType.StatusMessage)
            If Not Me.isEventRegistered Then
                AddHandler SettingsPane.GetForCurrentView.CommandsRequested, _
                    AddressOf onCommandsRequested
                Me.isEventRegistered = True
            End If
        End If
    End Sub

    Private Sub onSettingsCommand(command As IUICommand)
        Dim settingsCommand As SettingsCommand = DirectCast(command, SettingsCommand)
        rootPage.NotifyUser( _
        "You selected the " & settingsCommand.Label & " command from the " & SettingsPane.Edge.ToString(), _
        NotifyType.StatusMessage)
    End Sub

    Private Sub onCommandsRequested(settingsPane As SettingsPane, _
        eventArgs As SettingsPaneCommandsRequestedEventArgs)
        Dim handler As New UICommandInvokedHandler(AddressOf onSettingsCommand)

        Dim generalCommand As New SettingsCommand("generalSettings", "General", handler)
        eventArgs.Request.ApplicationCommands.Add(generalCommand)

        Dim helpCommand As New SettingsCommand("helpPage", "Help", handler)
        eventArgs.Request.ApplicationCommands.Add(helpCommand)
    End Sub


    '' This is the click handler for the 'addSettingsScenarioShow' button.  
    '' Replace this with your own handler if you have a button or buttons on this page.
    Private Sub addSettingsScenarioShow_Click(sender As Object, e As RoutedEventArgs)
        Dim b As Button = TryCast(sender, Button)
        If b IsNot Nothing Then
            rootPage.NotifyUser("You selected the " & b.Content & " button", _
                NotifyType.StatusMessage)
            SettingsPane.Show()
        End If
    End Sub
#include "pch.h"
#include "AddSettingsScenario.xaml.h"

using namespace ApplicationSettings;

using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::UI::ApplicationSettings;
using namespace Windows::UI::Popups;

void ApplicationSettings::AddSettingsScenario::addSettingsScenarioAdd_Click(
    Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
    Button^ b = safe_cast<Button^>(sender);
    if (b != nullptr)
    {
        rootPage->NotifyUser("You selected the " + b->Content + " button", 
            NotifyType::StatusMessage);
        if (!this->isEventRegistered)
        {
            this->commandsRequestedEventRegistrationToken = 
                SettingsPane::GetForCurrentView()->CommandsRequested += 
                    ref new TypedEventHandler<SettingsPane^, 
                    SettingsPaneCommandsRequestedEventArgs^>(this, 
                        &AddSettingsScenario::onCommandsRequested);
            this->isEventRegistered = true;
        }
    }
}

void ApplicationSettings::AddSettingsScenario::onSettingsCommand(
    Windows::UI::Popups::IUICommand^ command)
{
    SettingsCommand^ settingsCommand = safe_cast<SettingsCommand^>(command);
    rootPage->NotifyUser(
        "You selected the " + settingsCommand->Label + " settings command from the " + 
        SettingsPane::Edge.ToString(), NotifyType::StatusMessage);
}

void ApplicationSettings::AddSettingsScenario::onCommandsRequested(
    Windows::UI::ApplicationSettings::SettingsPane^ settingsPane,
    Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs^ eventArgs)
{
    UICommandInvokedHandler^ handler = ref new UICommandInvokedHandler(
        this, &AddSettingsScenario::onSettingsCommand);

    SettingsCommand^ generalCommand = ref new SettingsCommand(
        "generalSettings", "General", handler);
    eventArgs->Request->ApplicationCommands->Append(generalCommand);

    SettingsCommand^ helpCommand = ref new SettingsCommand("helpPage", "Help", handler);
    eventArgs->Request->ApplicationCommands->Append(helpCommand);
}

설명

참고

이 클래스는 민첩하지 않으므로 스레딩 모델 및 마샬링 동작을 고려해야 합니다. 자세한 내용은 스레딩 및 마샬링(C++/CX)다중 스레드 환경(.NET)에서 Windows 런타임 개체 사용을 참조하세요.

속성

Edge

참고

SettingsPane은 더 이상 사용되지 않으며 모든 버전의 Windows 10 작동하지 않을 수 있습니다. SettingsPane을 사용하는 대신 앱 환경에 설정 옵션을 통합합니다. 자세한 내용은 앱 설정에 대한 지침을 참조하세요.

화면의 왼쪽 또는 오른쪽 가장자리에 설정 참이 표시되는지 여부를 나타내는 값을 가져옵니다.

메서드

GetForCurrentView()

참고

SettingsPane은 더 이상 사용되지 않으며 모든 버전의 Windows 10 작동하지 않을 수 있습니다. SettingsPane을 사용하는 대신 앱 환경에 설정 옵션을 통합합니다. 자세한 내용은 앱 설정에 대한 지침을 참조하세요.

현재 앱 보기(CoreWindow 사용)와 연결된 SettingsPane 개체를 가져옵니다.

Show()

참고

SettingsPane은 더 이상 사용되지 않으며 모든 버전의 Windows 10 작동하지 않을 수 있습니다. SettingsPane을 사용하는 대신 앱 환경에 설정 옵션을 통합합니다. 자세한 내용은 앱 설정에 대한 지침을 참조하세요.

사용자에게 설정 참 창을 표시합니다.

이벤트

CommandsRequested

참고

SettingsPane은 더 이상 사용되지 않으며 모든 버전의 Windows 10 작동하지 않을 수 있습니다. SettingsPane을 사용하는 대신 앱 환경에 설정 옵션을 통합합니다. 자세한 내용은 앱 설정에 대한 지침을 참조하세요.

사용자가 설정 창을 열 때 발생합니다. 이 이벤트를 수신 대기하면 앱이 설정 명령을 초기화하고 사용자가 창을 닫을 때까지 UI를 일시 중지할 수 있습니다.

이 이벤트 중에 SettingsCommand 개체를 사용 가능한 ApplicationCommands 벡터에 추가하여 SettingsPaneUI에서 사용할 수 있도록 합니다.

적용 대상

추가 정보