Silverlight 4: New features overview (Part 4) – Out-of-browser applications: even more features - DevCorner

Silverlight 4: New features overview (Part 4) – Out-of-browser applications: even more features

In addition to previous features, Silverlight 4 adds some more nice improvements to Out-of-Browser model.

Now it allows to control Top/Left position of the out-of-browser window, bring it to the foreground (if not active), check if the window is topmost and define it’s Width/Height.

All those features being exposed by MainWindow object of Application:

image

Additional feature is Notification Window. It is a notification area that is displayed in the system area, at the bottom right part of the screen. In application described at previous post (here) I’ve added a button to show notification window.

image

I’ve added and Silverlight control to the project, and it will be the UI of my notification window:

image

At the “Notification” button event handler:

if (App.Current.IsRunningOutOfBrowser)
{
    NotificationWindow nw = new NotificationWindow();
    nw.Width = 250;
    nw.Height = 100;
    nw.Content = new Toast();
    nw.Show(5000); //Show the window for 5 seconds
}

Running application:

image

Sample code here (also for the previous Elevated Out-of-Browser post).

 

Stay tuned for the next part – DataBinding improvements.

Enjoy,

Alex

Published Wednesday, November 18, 2009 9:23 PM by Alex Golesh

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: