Understanding Page Orientation in Silverlight for Windows Phone

At MIX this year, Silverlight developers were handed a real treat: their first look at Silverlight for Windows Phone. Silverlight is the primary platform that developers will use to write applications for the new Windows phone, which will debut later this year. I can’t remember being this excited about a platform since…well, since Silverlight 1.0.…

Asynchronous Controllers in ASP.NET MVC 2

I’ve been working with version 2 of Microsoft’s ASP.NET MVC framework and have found a lot to like about it, particularly the new support for client-side validation based on data annotations. But the feature that excites me the most is support for asynchronous controllers and controller methods. Asynchronous pages have always been the secret to…

Silverlight 4’s New INavigationContentLoader Interface

One of the extensibility points added to the run-time in Silverlight 4 is the new INavigationContentLoader interface, which allows applications that use Silverlight’s navigation framework to take control of page loading. In Silverlight 3, navigation URIs had to target XAML files containing Silverlight pages. In Silverlight 4, a navigation URI can target anything—a class name,…

Silverlight 4’s New Notification Windows

Silverlight 4 includes a slew of features designed to make out-of-browser applications richer. One of those features is notification windows, also known as “toast” windows. This feature is available to all OOBs, regardless of whether they are trusted. It is not available to applications that run inside the browser. A notification window is one that…

Silverlight 4’s New Managed Extensibility Framework

One of the less-talked-about features of Silverlight 4 is the new Managed Extensibility Framework, or MEF. MEF has been evolving on CodePlex for a while now. It’s slated to be integrated into .NET 4.0 and Silverlight 4, and as such is something with which developers should be familiar. As its name implies, MEF is a framework…

Silverlight 4’s New HTML Hosting Support

Another of the new capabilities that Silverlight 4 brings to the platform is the ability to host HTML content inside a Silverlight control. This support isn’t limited to static HTML content; the content can be interactive and can include script. It can even be Flash content or content that includes other Silverlight controls. To host…

Silverlight’s Big Image Problem (and What You Can Do About It)

Quick: Can you spot the problem with these three lines of code? BitmapImage bi = new BitmapImage(); bi.SetSource(stream); TheImage.Source = bi; These statements create an image from a stream of PNG or JPG image bits and display the image by assigning it to a XAML Image object named TheImage. It’s boilerplate code used to display images read…

Silverlight 4’s New Local File System Support

In my last blog post, I wrote about Silverlight 4 applications that run outside the browser with elevated permissions and their ability to leverage COM automation servers on the host PC. Another privilege that applications with elevated permissions—also known as “trusted apps”—enjoy is the ability to access parts of the local file system without prompting the…

Silverlight 4’s New COM Automation Support

One of Silverlight 4’s most compelling new features is support for out-of-browser applications with elevated permissions. An app running with elevated permissions can perform actions that a normal sandboxed application can not. For example, it can access the local file system, and on Windows boxes, it can interact with COM automation servers. This latter feature—also…

Silverlight 4’s New Commanding Support

One of the exciting new features in the Silverlight 4 beta is a pair of properties added to the ButtonBase and Hyperlink classes named Command and CommandParameter. These properties represent the first real support in Silverlight for commanding, which is primarily beneficial to to Model-View-ViewModel (MVVM) applications. MVVM has long been popular among WPF developers…

Silverlight 4’s New Drag-and-Drop Support

Another new feature of Silverlight 4 that will enable developers to build richer UIs is drag-and-drop file support. In Silverlight 3, you had to pop up an OpenFileDialog to allow the user to select files from the local file system and make them available to a Silverlight application. In Silverlight 4, OpenFileDialog still works, but there…

Silverlight 4’s New Clipboard Support

Among the many new features coming in Silverlight 4 is clipboard support. A new class named System.Windows.Clipboard provides three static methods for accessing the system clipboard: GetText, which retrieves text from the clipboard SetText, which places text on the clipboard ContainsText, which indicates whether the clipboard currently contains text In the Silverlight 4 beta, only Unicode text…