다음을 통해 공유


AppNotificationBuilder.AddText 메서드

정의

오버로드

AddText(String)

앱 알림에 대한 XML 페이로드에 텍스트 블록을 추가합니다.

AddText(String, AppNotificationTextProperties)

앱 알림에 대한 XML 페이로드에 표시 및 지역화 옵션이 있는 텍스트 블록을 추가합니다.

AddText(String)

앱 알림에 대한 XML 페이로드에 텍스트 블록을 추가합니다.

public:
 virtual AppNotificationBuilder ^ AddText(Platform::String ^ text) = AddText;
/// [Windows.Foundation.Metadata.Overload("AddText")]
AppNotificationBuilder AddText(winrt::hstring const& text);
[Windows.Foundation.Metadata.Overload("AddText")]
public AppNotificationBuilder AddText(string text);
function addText(text)
Public Function AddText (text As String) As AppNotificationBuilder

매개 변수

text
String

Platform::String

winrt::hstring

앱 알림에 표시할 텍스트가 포함된 문자열입니다.

반환

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

특성

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드에 텍스트 블록을 추가하는 방법을 보여 줍니다.

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

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

앱 알림에 최대 3개의 텍스트 요소를 추가할 수 있습니다. 이 제한을 초과하면 오류가 발생합니다.

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

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

적용 대상

AddText(String, AppNotificationTextProperties)

앱 알림에 대한 XML 페이로드에 표시 및 지역화 옵션이 있는 텍스트 블록을 추가합니다.

public:
 virtual AppNotificationBuilder ^ AddText(Platform::String ^ text, AppNotificationTextProperties ^ properties) = AddText;
/// [Windows.Foundation.Metadata.Overload("AddText2")]
AppNotificationBuilder AddText(winrt::hstring const& text, AppNotificationTextProperties const& properties);
[Windows.Foundation.Metadata.Overload("AddText2")]
public AppNotificationBuilder AddText(string text, AppNotificationTextProperties properties);
function addText(text, properties)
Public Function AddText (text As String, properties As AppNotificationTextProperties) As AppNotificationBuilder

매개 변수

text
String

Platform::String

winrt::hstring

앱 알림에 표시할 텍스트가 포함된 문자열입니다.

properties
AppNotificationTextProperties

텍스트에 대한 표시 및 지역화 속성을 지정하는 AppNotificationTextProperties 입니다.

반환

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

특성

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드에 텍스트 블록을 추가하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.", new AppNotificationTextProperties().SetMaxLines(2))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text hint-maxLines='2'>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

앱 알림에 최대 3개의 텍스트 요소를 추가할 수 있습니다. 이 제한을 초과하면 오류가 발생합니다.

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

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

적용 대상