A new addition to Silverlight 4 is the NotificationWindow. This type of window enables you to show a System notification much like when you receive an Outlook new mail notification or a Growl notification in OSX. Since it operates like a system message, this feature is only available in Out of Browser (OOB) scenarios.
This example shows how to instantiate a NotificationWindow, with the resulting application like the below screenshot.
Code
And now for the code. The items to note:
- In the Tick event check to see if the application is running in OOB.
- If yes, then instantiate a NotificationWindow object.
- Set the Content (this could be as simple as a TextBlock or a custom UserControl)
- To show the Notification, call the Show method specifying, in milliseconds, the duration of the Notification.
Q: Can I show multiple notifications?
A: No, there isn’t a queue.
Q: Can the user interact with the NotificationWindow?
A: Yes, but only mouse support.
Q: What is the size of the NotificationWindow?
A: 400×100 (btw, I love Pixus)
Q: Can the NotificationWindow be customized?
A: Yes, below is a screenshot of the notification window using a custom UserControl instead of a TextBlock like the above example.



November 19th, 2009 at 7:49 pm
[...] The NotificationWindow [...]
November 22nd, 2009 at 11:39 pm
While a queue mechanism isn’t *in* the NotificationWindow API, we can still create one using Queue<T> — see: http://timheuer.com/blog/archive/2009/11/22/silverlight-4-notification-window-queue-sample.aspx (and thanks for getting my brain thinking)
November 23rd, 2009 at 12:21 am
[...] reading Corey’s post showing a quick FAQ on customizing the experience of the NotificationWindow, I was drawn to the comment he made about [...]
December 6th, 2009 at 12:18 pm
[...] Notification Window. [...]
December 9th, 2009 at 10:52 am
[...] notificationwindow-silverlight Опубликовано в IT. Метки: Silverlight. Оставьте комментарий [...]