How to: Bind a Notification Channel to an Application Tile or to a Toast Notification

[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

4/22/2010

In order to receive tile or toast notifications when your application is not in the foreground, you must bind a notification channel to both an application tile and a toast notification.


Binding a Notification Channel to a Tile Notification

The following code sample describes how to bind a notification channel to a tile notification, referencing a local resource. If this function is used, the cloud service will only ever be able to push tile notifications that reference local resources..

try
{
     httpChannel.BindToShellEntryPoint();
}
catch (NotificationChannelNotOpenedException)
{
     ...
}
catch (NotificationChannelException exc)
{
     ...
}

The following code sample describes how to bind a notification channel to a tile notification, referencing a remote resource. If this function is used, the cloud service can either push tile notifications that reference local resources or remote resources in the future.

try
{
      ShellEntryPoint Tile = new ShellEntryPoint();
      Tile.RemoteImageUri = new Uri("http://www.contoso.com/resources/image.png");
      httpChannel.BindToShellEntryPoint(Tile);
}
catch (NotificationChannelNotOpenedException)
{
      ...
}
catch (NotificationChannelException exc)
{
      ...
}

Binding a Notification Channel to a Toast Notification

The following code sample describes how to bind a notification channel to a toast notification.

try
{
      httpChannel.BindToShellNotification();
}
catch (NotificationChannelNotOpenedException)
{
      ...
}
catch (NotificationChannelException exc)
{
      ...
}

Show: