Compartilhar via


AppNotificationTextProperties Construtor

Definição

Inicializa uma nova instância da classe AppNotificationTextProperties , que especifica as propriedades de exibição e localização do texto.

public:
 AppNotificationTextProperties();
 AppNotificationTextProperties();
public AppNotificationTextProperties();
function AppNotificationTextProperties()
Public Sub New ()

Exemplos

O exemplo a seguir demonstra como adicionar um bloco de texto ao conteúdo XML para uma notificação de aplicativo.

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

AppNotificationManager.Default.Show(notification);

O conteúdo XML resultante:

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

Comentários

Adicione texto com propriedades de texto a uma notificação de aplicativo chamando AppNotificationBuilder.AddText.

Aplica-se a