O'Reilly logo

Microsoft Silverlight 4 Business Application Development Beginner's Guide by Frank LaVigne, Cameron Albert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - creating an out-of-browser solution

Adding out-of-browser support to a Silverlight application is quite easy, as shown below:

  1. Create a new Silverlight application in Visual Studio and name it OutOfBrowserTestApp.
  2. Add the following XAML code to the Grid named LayoutRoot in the MainPage.xaml file:
    <Button x:Name="btnInstallLocally"
    Content="Install Locally"
    Click="btnInstallLocally_Click"
    Height="23"
    Width="109"
    HorizontalAlignment="Left"
    Margin="12,30,0,0"
    VerticalAlignment="Top"
    />
    
  3. In the MainPage.xaml.cs file, add the following code:
    private void btnInstallLocally_Click(object sender, RoutedEventArgs e)
    {
    Application.Current.Install();
    }
    
  4. Your MainPage.xaml should look like this in design view:
  5. Next, we will enable out of browser ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required