Tag Archives: Silverlight 5

Silverlight 5 is now available

12 Dec

This weekend Silverlight 5 was released. Pete Brown has written a fine overview of the new features here. The new version is available at silverlight.net – downloads are available here and an overview of the new stuff in Silverlight 5 can be downloaded here.

//xamlgeek

Slides from my Silverlight 5 talk

25 May

Tonight I’m doing a talk at “Silverlight developers in Denmark” (SLDEV). The talk will focus on the new features in Silverlight 5 and I promise I will bring lots of demos.

You can download the slides here.

by xamlgeek 
@xamlgeek

Silverlight 5 – Default file name in SaveFileDialog

25 May

A long requested feature coming with Silverlight 5 is the opportunity to set the default file name in the SaveFileDialog. In previous versions of Silverlight this missing feature have resulted in some bad user experiences, but finally it is here and it is easy to use.

To demonstrate it I have create a demo writing a text file to the computer allowing the user to set the default file name from the very beginning.

2011-05-25_013727

When the user clicks the Save-button the SaveFileDialog is shown and the user can save the file locally on the computer. The text from the TextBox is parsed to the SaveFileDialog as the default file name.

2011-05-25_013804

In the code I have set the Filter, the DefaultExt and the DefaultFileName on my SaveFileDialog instance. This provide an optimal experience for my user when saving files.

2011-05-25_013908

You can download the demo here.

by xamlgeek 
@xamlgeek

Silverlight 5 – Custom Markup Extensions

20 Apr

A Markup Extension is a class that decides at runtime how to set a property’s value. Markup extensions allow code to be run at XAML parse time for both properties and event handlers.

In Silverlight 4 we got some different Markup Extensions:

  • Binding
    Text=”{Binding Path=FirstName, Mode=TwoWay}”
  • StaticResource
    Foreground=”{StaticResource BlueSolidColor}”
  • TemplateBinding
    VerticalAlignment=”{TemplateBinding VerticalContentAlignment}”
  • NullExtension
    Background={x:Null}
  • RelativeSource
    DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"

With Silverlight 5 we get Custom Markup Extensions allowing us to write more specific and complex Markup Extensions.

Jeff Prosise’s have written a good sample here and Jeremy Likness have written about getting creating a custom markup extension that uses MEF to satisfy imports on object instances declared in XAML here.

by xamlgeek
@thomasmartinsen

Silverlight 5 – Elevated Trust In-Browser

20 Apr

In Silverlight 5 it is possible to enable applications to run with elevated permissions in-browser.

The code snippet below will open Notepad.exe using the AutomationFactory in Silverlight. Using the AutomationFactory requires elevated permissions.

clip_image001

To run the snippet in Silverlight 4 the application must run with elevated permissions and in out-of-browser. In Silverlight 5 it is possible to run the snippet in-browser and with elevated permissions.

There are some requirements that need to be fulfilled to be able to run with elevated permissions in-browser. The XAP file needs to be signed with a certificate present in the Trusted Publishers Certificate store. Furthermore it is necessary to add a registry setting:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight\

Add the following DWORD key "AllowElevatedTrustAppsInBrowser" with 0x00000001.

In order to make development a bit easier running using localhost (or 127.0.0.1) won’t require signing the XAP file or adding the registry setting.

You can download the demo here.

by xamlgeek
@thomasmartinsen

The Future of Silverlight

3 Dec

Yesterday Scott Guthrie announced a beta of Silverlight 5, which will be available in Q2 of 2011 and released in 2011.

Silverlight 5 builds on the foundation of Silverlight 4 for building business applications, premium media applications and applications that reach beyond the browser. Silverlight 5 introduces more than 40 new features, including support for running Silverlight applications with desktop features in the browser, dramatic video quality and performance improvements, and features that improve developer productivity. The Silverlight 5 beta will be available sometime in Q2 of 2011.

Learn more information about the future of Silverlight at http://www.microsoft.com/silverlight/future/.

Watch the Silverlight Firestarter keynote.
Read about the announcement in Scott Guthrie’s blog.

by xamlgeek 
@thomasmartinsen