Share via


AppNotificationBuilder.MuteAudio Method

Definition

Requests that the system mute any audio associated with the app notification.

public:
 virtual AppNotificationBuilder ^ MuteAudio() = MuteAudio;
AppNotificationBuilder MuteAudio();
public AppNotificationBuilder MuteAudio();
function muteAudio()
Public Function MuteAudio () As AppNotificationBuilder

Returns

Returns the AppNotificationBuilder instance so that additional method calls can be chained.

Examples

The following example demonstrates requesting audio muting in the XML payload for an app notification.

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

AppNotificationManager.Default.Show(notification);

The resulting XML payload:

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

Remarks

To specify the audio for an app notification, use SetAudioEvent or SetAudioUri.

For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.

For reference information about the XML schema for app notifications, see App notification content schema.

Applies to