다음을 통해 공유


AppNotificationButton.ToolTip 속성

정의

앱 알림 단추의 도구 설명 텍스트를 가져오거나 설정합니다.

public:
 property Platform::String ^ ToolTip { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring ToolTip();

void ToolTip(winrt::hstring value);
public string ToolTip { get; set; }
var string = appNotificationButton.toolTip;
appNotificationButton.toolTip = string;
Public Property ToolTip As String

속성 값

String

Platform::String

winrt::hstring

도구 설명 텍스트가 포함된 문자열입니다.

예제

다음 예제에서는 이 속성을 사용하여 앱 알림 단추에 대한 도구 설명을 설정하는 방법을 보여 줍니다.

var button = new AppNotificationButton("Reply")
    .AddArgument("action", "reply");

if (AppNotificationButton.IsToolTipSupported())
{
    button.ToolTip = "Click to reply.";
}

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(button)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

긴급 시나리오가 지원되는 경우 결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply' hint-toolTip='Click to reply'/>
    </actions>
</toast>

설명

AppNotificationButton.SetToolTip 메서드를 호출하여 도구 설명 텍스트를 설정할 수도 있습니다.

도구 설명 텍스트는 Windows 10 빌드 19041 이상에서만 지원됩니다. AppNotificationButton.IsToolTipSupported를 호출하여 현재 디바이스에서 도구 팁이 지원되는지 런타임에 확인합니다.

AppNotificationBuilder API를 사용하여 앱 알림에 대한 UI를 만드는 방법에 대한 지침은 앱 알림 콘텐츠를 참조하세요.

앱 알림에 대한 XML 스키마에 대한 참조 정보는 앱 알림 콘텐츠 스키마를 참조하세요.

적용 대상