Tag Archive: OOB Isolated Storage


In this blog post I will show you how to manage custom window and it’s events like Minimizing Window, Maximizing Window etc… , while running the application Out Of Browser. We will also use IsolatedStorageSettings API that requires the application to be trusted.

 

First of all I have added a new “CustomWindowPage” and then changed the RootVisual of my application as throughout this series of blog posts I will use the same solution so I have do it in App.xaml.cs file as shown in the image below.

Click the image to show in full view.

Now go to, => Silverlight Project ==> Properties ==> Silverlight Tab ==> Check the checkbox “Enable running application out of the browser” ==> Click “Out-of-Browser Settings…” button ==>check the checkbox “Require elevated trust when running outside the browser” and select the “No Border” from Window Style drop down menu as shown in the image below…

This will make changes in “OutOfBrowserSettings.xml” file as shown in the image below.

Now I have added some UI elements and wired up some events with them in the “CustomWindowPage.xaml” file as shown in the image below…

This will render the page in browser as shown in the image below…

Clicking on the “Install App” button will open the InstallWindow in the browser as shown in the Image below…

Now here one must notice couple of things,

1.> This Install Window is somehow different then in the first blog post (Check the image below).

2.> Second thing is the window in the image above is actually showing security warning to the user, who is trying to install the app on the local system.

It is because in Silverlight 4 wishlist, one thing users have been asking for is to enable Silverlight out-of-browser (OOB) applications to have more privileges.  And so now with this option we can now alter the OOB manifest to request more elevated permissions for our application. So this is the install window which actually warns the user that this application can access your system more then in compare of non trusted application.

We actually need to sign the xap file here that the user does not get such security warning and I will cover that part in my future blog post in this series.

In silverlight OOB app this elevated trust is required for many functionalities like to access local files on user’s machine, for COM interoperability and lot more. I will go through all this topics particularly in my upcoming blog posts in this blog series.

Now clicking on “Install” button in install window will open the app Out of Browser as shown in the image below…

You can minimize, maximize, resize, relocate and close this window because of the code shown here in the following image…

Here in the bottom of this image, there is the code to save window height and width into local system’s isolated storage. and finally following image contains the code which actually requires the elevated trust to run in our case.

In this code we are just retrieving the height and width of the window which was saved last time when window was closed.

So it was the second part of silverlight OOB blog series. Hope you find it interesting and fill free to put comments and questions below.

For more info on silverlight, just go to, http://www.silverlight.net

For more on silverlight 4, click here, http://www.silverlight.net/getstarted/silverlight-4/

For more details on Silverlight 4.0, you can also browse through following blogs………

http://timheuer.com/blog/          —  Tim Heuer Blog – Silverlight Program Manager

http://blogs.silverlight.net/blogs/jesseliberty/       — Jesse Liberty Blog – Silverlight Program Manager

http://johnpapa.net/              —  John Papa website

http://adamkinney.wordpress.com/          — Adam Kinney Blog — For Silverlight graphics, interface and Expression Blend

I am planning for a multi part blog series on Silverlight Out Of Browser Capabilities using Silverlight 4.

Recently I have explored the silverlight’s capabilities as an Out Of Browser application and I found it’s very much sound and interesting.

But what I have noticed is all the features of silverlight OOB (Out Of Browser) capabilities are not available at one place or not really available in proper order to explore for any developer like me. So I have decided to write a multi part blog series on Silverlight’s Out Of Browser capabilities.

So in next couple of months I will write around 8 blogs on the topic and the current list of  blogs is as following……

1.> Getting Started with Silverlight’s Out of Browser Capabilities

2.> OOB Custom window and events

3.> OOB Notification API

4.> OOB Trusted File Access

5.> OOB Trusted Network Access

6.> OOB Trusted COM API

7.> OOB XAP signing for trusted Applications

8.> OOB Using Isolated Storage

I will try to publish these blogs on time and in given order.

As I will write the blog, I will link that blog with the list given here that anyone can simply browse through any blog on the topic from here only.

I will use Windows 7 Ultimate 64 bit, Visual Studio 2010 and Silverlight 4.0 throghout the blog series.