Поделиться через


AppNotificationDuration Перечисление

Определение

Указывает длительность отображения AppNotification .

public enum class AppNotificationDuration
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
enum class AppNotificationDuration
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
public enum AppNotificationDuration
var value = Microsoft.Windows.AppNotifications.Builder.AppNotificationDuration.default
Public Enum AppNotificationDuration
Наследование
AppNotificationDuration
Атрибуты

Поля

Default 0

Длительность по умолчанию.

Long 1

Длинная длительность.

Примеры

В следующем примере показано задание длительности в полезных данных XML для уведомления приложения.

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

AppNotificationManager.Default.Show(notification);

Результирующие полезные данные XML:

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

Комментарии

Задайте длительность уведомления приложения, вызвав AppNotificationBuilder.SetDuration.

Применяется к