다음을 통해 공유


AppNotificationButton.SetToolTip(String) 메서드

정의

앱 알림 단추의 도구 설명 텍스트를 설정합니다.

public:
 virtual AppNotificationButton ^ SetToolTip(Platform::String ^ value) = SetToolTip;
AppNotificationButton SetToolTip(winrt::hstring const& value);
public AppNotificationButton SetToolTip(string value);
function setToolTip(value)
Public Function SetToolTip (value As String) As AppNotificationButton

매개 변수

value
String

Platform::String

winrt::hstring

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

반환

추가 메서드 호출을 연결할 수 있도록 AppNotificationButton instance 반환합니다.

예제

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

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

if (AppNotificationButton.IsToolTipSupported())
{
    button.SetToolTip("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.ToolTip 속성을 사용하여 도구 설명 텍스트를 설정할 수도 있습니다.

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

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

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

적용 대상