BusinessRx Community

Dedicated to the advancement of software, technology and the people who devote their lives to it.

Welcome to BusinessRx Community Sign in | Join | Help
in Search

BusinessRx Reading List

These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.

Browse by Tags

All Tags » .NET » Silverlight   (RSS)

  • Update on Silverlight 2 - and a glimpse of Silverlight 3

    We shipped Silverlight 2 last month.  Over the last 4 weeks, the final release of Silverlight 2 has been downloaded and installed on more than 100 million consumer machines.  It has also recently been published to corporate administrators via the Microsoft SMS and Microsoft Update programs to enable them to automatically deploy across enterprises.  Over 1 in 4 computers on the Internet now have some version of Silverlight installed.

    Silverlight 2 was a major release, and delivered an impressive set of cross-browser, cross-platform functionality for Media and Rich Internet Application experiences.  It has been great watching new sites launch using it.

    Media Experiences

    Silverlight 2 enables the highest quality video on the web, and delivers it with the lowest TCO of any media platform.

    One of the capabilities built-into Silverlight 2 is its support for "adaptive streaming" - which enables video to be delivered at multiple bitrates (for example: 400Kbits, 800Kbits, 1.5Mbits, 2Mbits) with Silverlight dynamically choosing the optimal bitrate to use depending on the network bandwidth and CPU capability of the client (it can also automatically switch bitrates seamlessly if conditions change later). 

    Silverlight's adaptive streaming support is extensible.  Move Networks (who helped pioneer the concept of adaptive streaming) have already integrated their adaptive streaming solution with Silverlight.  Silverlight 2 and Move were used to stream the Democratic National Convention live on the web this summer. 

    Last month we announced that Microsoft will be adding adaptive streaming support as a free feature of our IIS7 web-server.  IIS Smooth Streaming will provide an integrated way to deliver HD quality adaptive video over the web. Visit Akamai's www.smoothhd.com site to see some awesome examples of Silverlight 2 and IIS Smooth Streaming in action (with adaptive streaming up to 2.5Mbits).

    The NBC Olympics site used Silverlight 2 to serve more than 3,500 hours of live and on-demand Olympic coverage to over 60 million unique visitors this summer.  Visitors to the site watched an average of 27 minutes of video - which is stunningly high for online video.  The site used the new Silverlight adaptive streaming capability to support 1.5Mbit bitrates - which helped deliver an awesome video experience:

    In addition to powering the Olympics experience in the US, Silverlight was also used in France (by FranceTV), the Netherlands (by NOS), Russia (by Sportbox.ru) and Italy (by RAI).  In addition to video quality, a big reason behind these broadcasters decision to use Silverlight was the TCO and streaming cost difference Silverlight provided.  In the August 2008 edition of Web Designer Magazine (a Dutch publication) a NOS representative reported that they were able to serve 100,000 concurrent users using Silverlight and 40 Windows Media Servers, whereas it would have required 270 servers if they had used Flash Media Servers.

    Over the last month we've seen several major new deployments of Silverlight for media scenarios.  For example: CBS College Sports is now using Silverlight to stream NCAA events from its 170 partner colleges and university.  Blockbuster is replacing Flash with Silverlight for its MovieLink application. And Netflix two weeks ago rolled out its new Instant Watch service using Silverlight. 

    Rich Internet Applications (RIA) Experiences

    Silverlight 2 delivers a cross-browser, cross-platform subset of the .NET Framework, and enables developers to build Rich Internet Applications. 

    Developers can use either VS 2008 or the free Visual Web Developer 2008 Express to open and edit Silverlight 2 projects, and get a powerful code-focused .NET development environment.  Designers can use Expression Blend 2 SP1 to open and edit the same projects and use a creative tool to sculpt and create rich user experiences.  I recently blogged about the nice developer/designer workflow this enables here.  Two weeks ago at the PDC we also shipped the first release of our Silverlight Toolkit - an open source project which adds additional runtime controls and components for Silverlight 2 development (including new charting controls). 

    A number of customers have already launched Internet-facing Silverlight 2 RIA solutions (including Renault, Hard Rock and Toyota). For example, last month AOL launched their new AOL Mail RIA using Silverlight 2:

    Silverlight 2 is also now being used in a variety of enterprise solutions.  For example, K2 recently launched their new Blackpoint workflow management solution for Microsoft SharePoint using Silverlight:

    Microsoft is also deploying new Silverlight based RIA experiences.  The Windows Live Team's new photo application (photos.live.com) and video communications application (videomessages.live.com) are both built with Silverlight 2, as is the new MSN Toolbar (it uses Silverlight to customize the browser frame).  Last month at the PDC we also gave a first sneak-peak demo of some of the new Office 14 Web Companion RIA applications which use Silverlight.

    Silverlight 3

    Next year we will ship our next major Silverlight release -- Silverlight 3. 

    Silverlight 3 will include major media enhancements (including H.264 video support), major graphics improvements (including 3D support and GPU hardware acceleration), as well as major application development improvements (including richer data-binding support and additional controls).  Note these are just a small sampling of the improvements - we have plenty of additional cool features we are going to keep up our sleeves a little longer. ;-)

    Next year Visual Studio and Visual Web Developer Express will also support a fully editable and interactive designer for Silverlight, and add tool support for data-binding:

    We are pretty excited about where Silverlight is today, as well as the roadmap in place over the next year.  It has been really great to watch customers go live with cool solutions.  The next year is going to be a fun one as more and more sites launch with Silverlight 2, and as even bigger scenarios are enabled with Silverlight 3 and beyond. :-)

    Hope this helps,

    Scott

  • Styling a Silverlight Twitter Application with Expression Blend 2

    Silverlight 2 provides a rich platform for building cross-browser/cross-platform RIA applications. 

    One of the things that makes Silverlight so powerful is the ease with which developers and designers can collaborate together on projects.  Developers can use Visual Studio to open and edit Silverlight 2 projects and get a powerful code-focused .NET development environment, and designers can use Expression Blend 2 SP1 to open and edit the exact same project and use a creative tool to sculpt and create optimal user experience designs.

    The WPF UI framework shipped in Silverlight further enables a great designer/developer workflow by supporting concepts like layout management, controls, styles, templates, and resources - which help avoid scenarios where designers and developers end up tripping over each other when integrating functionality, behavior and expressive design.

    Silverlight 2 Twitter Sample

    Last month I posted an in-depth blog tutorial on how to build a Silverlight 2 Digg application which you can read here.  This tutorial was aimed primarily at developers, and focused on introducing the fundamental programming concepts involved when building a Silverlight 2 application. 

    Today Celso Gomes and Peter Blois posted a cool 10 minute video tutorial that shows off using Expression Blend to stylize a Silverlight 2 Twitter Messenger application.  You can watch the video here.  You can download the source code for the completed Silverlight Twitter application here.

    The video does a nice job demonstrating how designers can re-style a Silverlight application without having to mess with the code behind it.  In the process it shows some of the power and capability that Expression Blend 2 provides to build really rich user experiences.  Celso starts with a developer version of the application, and then customizes and sculpts the UI to have a fun twitter character theme:

    The Application Model

    The Silverlight Twitter client is hosted within an ASP.NET server application that exposes a web service that enables the Silverlight Twitter application to communicate to the Twitter service (since Twitter does not allow direct access from client applications). Communication between the Silverlight client and the ASP.NET web server is done using Windows Communication Foundation (WCF).

    The client application uses a Model-View-Presenter (MVP) pattern (also known as the Model-View-ViewModel pattern) which is commonly used in large WPF applications. Even though this is a fairly simple application they wanted to take advantage of the flexibility that MVP allows and allow room for future growth. 

    Maintaining the separation between the visuals and the application logic also enables designers to make fairly complex visual changes without impacting the basic application flow.  The video goes through some examples of the styling flexibility this architecture facilitates.

    The Styling Process

    In the video, Celso highlights how Resources can help designers quickly change colors.  A common Brush Resource, for example, can be used to change the color of all the text elements in the application:

    Celso shows how easy is to create new User Controls from graphics using Expression Blend 2 SP1 (just select multiple elements in the designer, right-click, and choose the "Make Control" menu option):

    And also how to create new states inside this new User Control (using the Visual State Manager feature - which is also now supported with WPF), to animate the bird (fly, blink, etc...)

    Celso also shows how to create animations for each state, changing advanced properties like Key Spline curves, and Repeat Behavior:

    He also shows how to create custom buttons from drawings (which can come from XAML or any other design tool like Photoshop or Illustrator). All the states of a Button Control are available out of the box.

    Expression Blend also enables you to easily change complex controls like List Boxes. Designers have access to all Styles, Templates, and states - and can completely customize all the parts of a List Box without having to write any code:

    You can watch the video and download the code to check out the above Twitter application.

    To learn more about Expression Blend, I also recommend watching the Expression Blend: Tips and Tricks presentation from the PDC conference two weeks ago.

    Hope this helps,

    Scott

  • October 22nd Links: ASP.NET, Visual Studio, WPF and Silverlight

    Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

    ASP.NET

    • Building a Great ASP.NET AJAX Application from Scratch: Brad Abrams has a nice end to end application tutorial that shows off building an ASP.NET AJAX application from scratch. It covers ASP.NET, LINQ, Server and Client-side AJAX, the ASP.NET AJAX Control Toolkit, jQuery and more.  A great end to end read.

    • ASP.NET MVC and the new IIS7 URL Rewriting Module: Scott Hanselman has a great post that shows off using the new IIS7 Rewriitng Module (which is free and very, very cool) to deliver great SEO (search engine optimization) for sites built with ASP.NET and specifically ASP.NET MVC. 

    Visual Studio

    • VS 2008 Snippet Designer: A cool utility that enables you to quickly create re-usable Visual Studio snippets.  Very handy for automating common tasks.

    Silverlight and WPF

    • XAML Power Toys Released for WPF and Silverlight: Karl Shifflett has released an awesome update to his XAML Power Toys download.  This is a must-have download if you are doing WPF or Silverlight development, and provides a bunch of great wizards and tools that help automating application development.  Very, very cool stuff.

    • WPF Pixel Shader Effects Library on CodePlex: .NET 3.5 SP1 added Pixel Shader support to WPF - which enables you to add cool DirectX optimized visual effects to any WPF control or surface.  This article from Jamie points to a nice new CodePlex project that is available that delivers a bunch of pre-built effects you can use.

    • Silverlight 2 UI Templates: Tim Heuer writes about some cool new UI templates available for the recently released Silverlight 2.

    Hope this helps,

    Scott

  • Silverlight 2 Released

    Today we shipped the final release of Silverlight 2.  You can download Silverlight 2, as well the Visual Studio 2008 and Expression Blend 2 tool support to target it, here.

    Cross Platform / Cross Browser .NET Development

    Silverlight 2 is a cross-platform browser plugin that enables rich media experiences and .NET RIAs (Rich Internet Applications) within the browser.

    Silverlight 2 is small in size (4.6MB) and takes only 4-10 seconds to install on a machine that doesn't already have it.  It does not require the .NET Framework to be installed on a computer to run - the Silverlight setup download includes everything necessary to play video or run applications.

    Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby).  Silverlight provides a rich set of features for development including:

    • WPF UI Framework: Silverlight 2 includes a rich UI framework that makes building rich Web applications much easier.  In includes a powerful graphics and animation engine, as well as rich support for higher-level UI capabilities like controls, layout management, data-binding, styles, and template skinning.  The WPF UI Framework in Silverlight is a compatible subset of the WPF UI Framework features in the full .NET Framework, and enables developers to re-use skills, controls, code and content to build both rich cross browser web applications, as well as rich desktop Windows applications.
    • Rich Controls: Silverlight 2 includes a rich set of built-in controls that developers and designers can use to quickly build applications.  The Silverlight 2 release includes core form controls (TextBox, CheckBox, RadioButton, ComboBox, etc), built-in layout management panels (StackPanel, Grid, Panel, etc), common functionality controls (Slider, ScrollViewer, Calendar, DatePicker, etc), and data manipulation controls (DataGrid, ListBox, etc).  All Silverlight controls support a rich control templating model, which enables developers and designers to collaborate together to build highly polished solutions.
    • Rich Networking Support: Silverlight 2 includes rich networking support.  It includes out of the box support for calling REST, WS*/SOAP, POX, RSS, and standard HTTP services.  It supports cross domain network access (enabling Silverlight clients to directly access resources and data from resources on the web).  It also includes built-in sockets networking support.

    • Rich Base Class Library: Silverlight 2 includes a rich .NET base class library of functionality (collections, IO, generics, threading, globalization, XML, local storage, etc).  It includes rich APIs that enable HTML DOM/JavaScript integration with .NET code.  It includes LINQ and LINQ to XML library support (enabling easy transformation and querying of data), as well as local data caching and storage support.  The .NET APIs in Silverlight are a compatible subset of the full .NET Framework.
    • Rich Media Support: Silverlight 2 includes built-in video codecs for playing high definition video, as well as for streaming it over the web (including both live and on-demand support).  Silverlight includes support for adaptively switching video bitrates on the fly based on network conditions (enabling users to avoid seeing the dreaded "buffering..." message), placing and metering ads within video streams, as well as enabling content protection. 

    The final Silverlight 2 release delivers a tremendous amount of power and flexibility that enables you to really push the boundaries of what can be done in a browser, and enable great end user experiences.

    Silverlight Customers

    Over the last few months a number of very high profile sites have successfully launched using the beta releases of Silverlight 2. 

    In August, NBC hosted the Olympics live on nbcolympics.com and served up 1.3 billion page views, 70 million video streams, and 600 million minutes of video content - making it the largest ever media event on the web.  Users visiting the site spent an average of 27 minutes on the site when they watched a video - an unprecedented number for online traffic.

    In August, the Democratic National Convention was streamed live using Silverlight, and broadcast a 2Mbit live video feed of the event and speeches - receiving outstanding feedback from audiences watching it.

    This month a number of other high profile sites are going live with the final release of Silverlight 2.  CBS College Sports Network will be streaming 20,000 hours of live games for 150+ college and university partners.  AOL is launching their new AOL Mail browser version to 60 million users using Silverlight 2.  Blockbuster will be launching their new MovieLink subscription service using Silverlight.  Yahoo! Japan is live today enabling live streaming of Major League Baseball games.  Hard Rock International will be updating their memorabilia site with new features.  And companies like Toyota, HSN and hundreds of others will be live this week as well.

    Silverlight Control Pack

    Silverlight 2 ships with dozens of built-in UI controls that can be used to build applications.  Below is a screen-shot of the Silverlight DataGrid, RadioButton, CheckBox and DatePicker controls in the final release:


    Today we are also announcing the "Silverlight Control Pack" - which will deliver dozens of more controls that you can use with Silverlight 2.  We will continually add new controls to the control pack over the next few months (we expect to ultimately have more than 100 controls total).  The first release of the control pack will include controls like TreeView, DockPanel, WrapPanel, ViewBox, Expander, NumericUpDown, AutoComplete and more.  All controls will ship with full source, and with a OSI license that allows you to modify and use the source for any purpose.

    Interoperability

    Today we are also announcing that Microsoft is partnering with Soyatec to sponsor additional tools for developing Silverlight applications using the cross platform Eclipse development platform.  Click here to learn more about this and download the free Silverlight Eclipse plugin.  Click here for a step-by-step tutorial that walks-through how to use their Eclipse tools today to build a Silverlight 2 application. 

    We are also announcing today that we are releasing the Silverlight XAML vocabulary and schema under the Open Specification Promise (OSP), which enables anyone to create products that read and write XAML for Silverlight.

    Learning Silverlight 2

    The best way to learn Silverlight 2 is to visit the www.silverlight.net web-site.  You can find free online tutorials, videos and training available there.  The site also hosts an online forum system where MVPs and Microsoft Silverlight team members will be able to help answer technical questions.  Also make sure to subscribe to the Silverlight Community RSS Feed, Jesse Liberty's Blog, and Tim Heuer's Blog for a daily dose of great Silverlight content.

    I've recently updated my Digg-client tutorial for the final Silverlight 2 release.  This provides an end to end walkthrough of a Silverlight 2 application, and helps explain the different programming concepts behind it (controls, layout management, networking, data-binding, styles, user controls, control templates, etc).  If you are brand new to Silverlight or WPF development I recommend walking through it to understand the basics:

    You can develop Silverlight 2 applications using any version of Visual Studio 2008.  Simply install the Silverlight Tools for Visual Studio 2008 download to get Silverlight tooling support within it.

    If you do not have VS 2008, you can alternatively install the free Visual Web Developer 2008 Express SP1 Edition.  This free tool provides great ASP.NET development tool support, and starting today also now supports Silverlight 2 development.  You can follow all of the steps in my tutorial above using the Visual Web Developer 2008 Express Edition - and get full intellisense, debugging, and deployment support.

    Upgrading from the Beta

    If you have the Beta2 or RC versions of the VS Tools for Silverlight, or the Silverlight 2 Beta SDK or Developer Editions of Silverlight 2, please make sure to uninstall these completely before downloading and installing today's release.

    End users who have Silverlight 1, or Silverlight 2 Beta1 or Beta2 will be automatically upgraded to the final Silverlight 2 release starting later this month.  Until then, if they visit a Silverlight 2 (final release) site, they will see the standard install prompt that a machine that does not have Silverlight installed would see.  Clicking it will upgrade their machines to the final release of Silverlight 2 (there is no need for them to uninstall anything - Silverlight 2 will cleanly install over Silverlight 1 or the previous betas). 

    Because there are some breaking changes between Silverlight 2 Beta2 and the final Silverlight 2 release, end users who have the final Silverlight 2 release installed will not be able to run applications that are still targeting Silverlight Beta2.  Most major Silverlight 2 sites plan to upgrade to the final release in the next 24 hours (which will fix this issue) - if you hit a site built with Beta2 before then you might experience trouble with it.  That should go away within about a day once all sites are updated though (this was one reason why we released the public release candidate last month - to help developers get their sites ready for the final release).

    Summary

    Silverlight 2 is a major release that enables some great new application and media experiences to be built, and allows developers to use .NET within any browser to create them.

    Thank you for all your support and feedback the last year as we've worked on it.  All of us on the Silverlight team are really excited to see what you build with it. :-)

    Scott

  • Silverlight 2 Release Candidate Now Available

    This evening we published the first public release candidate of Silverlight 2.

    There are still a small handful of bugs fixes that we plan to make before we finally ship.  We are releasing today's build, though, so that developers can start to update their existing Silverlight Beta2 applications so that they'll work the day the final release ships, as well as to enable developers to report any last minute showstopper issues that we haven't found internally (please report any of these on the www.silverlight.net forums).

    Important: We are releasing only the Silverlight Developer Runtime edition (as well as the VS and Blend tools to support it) today, and are not releasing the regular end-user edition of Silverlight.  This is because we want to give existing developers a short amount of time to update their applications to work with the final Silverlight 2 APIs before sites are allowed to go live with it.  There are some breaking changes between Beta2 and this RC, and we want to make sure that existing sites can update to the final release quickly once the final release is out.  As such, you can only use the RC for development right now - you can't go live with the new APIs until the final release is shipped (which will be soon though).

    You can download today's Silverlight Release Candidate and accompanying VS and Blend support for it here.  Note that Expression Blend support for Silverlight 2 is now provided using Blend 2.0 SP1.  You will need to install Blend 2.0 before applying the SP1 service pack that adds Silverlight 2 support.  If you don't already have Blend 2.0 installed you can download a free trial of it here.

    Beta2->RC API Updates

    Today's release candidate includes a ton of bug fix and some significant performance optimization work.

    Today's release candidate also includes a number of final API tweaks designed to fix differences between Silverlight and the full .NET Framework.  Most of these changes are relatively small (order of parameters, renames of methods/properties, movement of types across namespaces, etc) although there are a number of them.  You can read this blog post and download this document to get a listing of the known API breaking changes made from the Beta2 release. 

    We have updated the styles of the controls shipped with Silverlight, and have also modified some of the state groups and control template names they use.  When upgrading from Beta2 you might find it useful to temporarily remove any custom style templates you've defined, and get your application functionality working using the RC first - and then after that works add back in the styles one style definition at a time to catch any rename/behavior change issues with them.

    If you find yourself stuck with an question/issue moving from Beta2 to the RC, please report it on the www.silverlight.net forums (Silverlight team members will be on there helping folks).  If after a day or two you aren't getting an answer please send me email (scottgu@microsoft.com) and I can help or connect you with someone who knows the answer.

    New Controls

    Today's release candidate includes a bunch of feature additions and tweaks across Silverlight 2, as well as in the VS and Blend tools targeting it. In general you'll find a number of nice improvements across the controls, networking, data caching, layout, rendering, media stack, and other components and sub-systems.

    Over the next few months we will be releasing a lot of new Silverlight 2 controls (more details on these soon).  Today's release candidate includes three new core controls - ComboBox, ProgressBar, and PasswordBox - that we are adding directly to the core Silverlight runtime download (which is still only 4.6MB in size, and only takes a few seconds to install):

    At runtime these controls by default look like:

    The ComboBox in Silverlight 2 supports standard DropDownList semantics.  In addition to statically defining items like above, you can also use databinding with it.  For example, we could define a "Person" class like below:

    And the add a ComboBox to a page like so:

    And then write the below code to databind a collection of Person objects to the ComboBox (by setting its ItemSource property):

    At runtime our simple app will then display the data-bound Person names (note that we set the DisplayMemberPath property on the ComboBox above to display the "Name" value from our Person objects):

    We could then implement a SelectionChanged event handler like below to run code when a person is selected from the ComboBox:

    Notice above how we can retrieve a reference to the selected "Person" object from the databound ComboBox using the ComboBox's "SelectedItem" property. 

    We can then call the MessageBox.Show() helper method (new in the RC) to display a modal dialog box that displays some details about our selected person:

     

    New Control Skins

    The final release of Silverlight 2 will have a much more polished set of default control template skins than those that were in Beta1 and Beta2.  Our goal with the default control templates is to have a look that is professional and attractive, can be used in the majority of applications as-is (without requiring you to author custom style templates), and which is also easily tweakable using Expression Blend.

    Today's RC build has skins that are close to the final look we plan to ship (there are a few final tweaks we are doing post RC on the focus color of controls, as well as to tighten up and tweak a few issues in some of the control templates).  Below is the default look for the DataGrid, RadioButton, CheckBoxes, and the DatePicker controls with today's RC build:

    Note that the DatePicker control above allows users to type in a date (with a masked edit to ensure it is a valid date), or they can click the calendar icon to the right of the textbox and select the date using a popup Calendar control:

    One of the most powerful features of Silverlight and WPF, of course, is the ability for designers and developers to completely customize the look and feel of any control.  This goes beyond simple styling of colors and fonts - you can literally completely change the visual UI of a control, as well as customize its behavior (for example: add animation) without writing any code.

    Within Expression Blend, simply right-click on any Silverlight control and choose the "Edit Control Parts" sub-menu to open and edit its control template:

     

    When in control template editing mode, you can manipulate any sub-element of a control (for example: a checkbox's inner content), as well as customize each "state" its in (notice the states pane circled in red below).  This allows designers to customize what the control looks like in individual states (for example: checked, unchecked, mouseover, etc).  Silverlight will then automatically handle animating the control from state to state depending on the user action:

    You can learn more about how Silverlight's Visual State Model works from my previous blog post here

    Previous releases of Silverlight often rendered graphics on sub-pixel locations - which could cause lines and shapes to sometimes appear "fuzzy".  The RC of Silverlight has a new features called "layout rounding" that causes the layout system to round the final measure of a control to an integer ("pixel snapping"), which results in crisper lines and fewer rendering artifacts.  This feature is now on by default, and helps make applications look nicer.

    Summary

    The final release of Silverlight is not that far off now.  It has been a pretty amazing project that has come a long way in a pretty short amount of time.

    If you have existing Beta2 applications, please start getting them ready for the final release - as once we release Silverlight 2, users that have existing beta releases installed will automatically be upgraded to use the final version.  Testing your application out with the release candidate will ensure that you can easily update your applications and have them ready within hours of the final release.

    Let us know if you find issues with today's release candidate, and please make sure to post them on the forums on http://www.silverlight.net.

    Hope this helps,

    Scott

  • Silverlight 2 Beta2 Released

    Silverlight 2 Beta2 was released today.  You can download both Silverlight 2 Beta2 and the Visual Studio and Expression Blend tools support to target it here.

    Beta2 adds a lot of new features (more details below), but is still a 4.6 MB download that takes less than 10 seconds to install on a machine.  It does not require the .NET Framework or any other software to be installed for it to work, and all features work cross-browser on both Mac and Windows machines.  These features will also be supported on Linux via the Moonlight 2 release.

    Silverlight 2 Beta2 supports a go-live license that allows you to start using and deploying Silverlight 2 for commercial applications. There will be some API changes between Beta2 and the final release, so you should expect that applications you write with Beta2 will need to make some updates when the final release comes out.  But we think that these changes will be straight-forward and relatively easy, and that you can begin planning and starting commercial projects now.

    You can build Silverlight Beta2 applications using the VS 2008 Tools for Silverlight and Expression Blend 2.5 June Preview downloads.  You can download both of them here.  The VS 2008 Tools for Silverlight download works with both VS 2008 and the recent VS 2008 SP1 beta release. 

    UI and Control Improvements

    Silverlight 2 Beta2 includes a bunch of work in the UI and Control space:

    More Built-in Controls

    In Beta 1 only a few controls were included with the core Silverlight setup.  Most common controls (including Button, ListBox, Slider, etc) were shipped within separate assemblies that you had to bundle with your applications (which increased the app download size).  Beta 2 now installs 30+ of the most common controls as part of the core Silverlight 2 download.  This means that you can now build Silverlight 2 applications that use core controls that are as small as 3kb in size - making Silverlight application downloads small and startup time fast.

    In addition to the core controls included with the base Silverlight 2 setup, we are also this week shipping additional higher-level controls that are implemented in separate assemblies that you can then reference and include with your applications.  This includes controls like DataGrid (more details on its new Beta2 features below), Calendar (now with multi-day selection and blackout date support in Beta2), and a TabPanel control (new in Beta2).

    We ultimately expect to ship over a 100 controls for Silverlight.

    Control Template Editing Support

    One of the most powerful features of the WPF and Silverlight programming model is the ability to completely customize the look and feel of controls.  This allows developers and designers to sculpt the UI of controls in both subtle and dramatic ways, and enables a tremendous amount of flexibility.  I covered these concepts a little in my previous Silverlight Control Templating blog post here.

    This week's Expression Blend 2.5 June Preview now adds designer support for editing control templates - which makes it easy for you to quickly change the look of any control without having to drop-down to XAML source to-do it. 

    To see control template editing in action, just drag/drop two Slider controls onto the Expression Blend design surface:

    We might decide that the slider head in the default Slider control template is too large and wide for our application.  To use control template editing to change it, we can right-click on one of the sliders in the designer and select the "Edit Control Parts" context menu item.  We can choose to create a new empty control template for our slider (and start from scratch), or alternatively edit a copy of the built-in control template (and start from that and tweak it):

    After we choose to edit a copy of the existing control template, Blend will prompt us to create and name a re-usable style resource that we'll define our control template within.  We can name it and then choose to store the style at either the application level (within App.xaml) or within our current page/user-control:

    When we click "ok" we'll find ourselves in template editing mode for our Slider control.  We can change, tweak, or add/remove any of the underlying elements within the Slider control's template.  Notice below how in template editing mode we can see and select any of the underlying elements that make up the slider's control template (these are circled in red below in the "Objects" window). 

    To make our slider head narrower, we can select the "HorizontalThumb" element within the control template and adjust its width (either graphically or via the property grid): 

    We can then use the breadcrumb navigation bar at the top of the designer to navigate back to our page and see the control template changes applied:

    Notice that right now only one of our slider controls is using the new Style resource with the control template we defined. 

    To apply the same style resource to the other slider control as well, we can select it, right-click, and then use the "Apply Resource" context menu to apply our "ScottSlider" style to it as well:

    Once we do this both our sliders reference the same style:

    Changes we make to the "ScottSlider" style going forward will automatically apply to both controls.

    Note that all controls shipped with Silverlight 2 support control templates and will support the above editing experience in Expression Blend.

    Visual State Manager (VSM) Support

    Control templates in Silverlight and WPF support customizing both the "look" of a control, as well as the "feel" of a control.  By "feel" I mean changing its interactive responsiveness.  For example: how it reacts when pushed, when it gets focus, loses focus, is in a pushed state, is in a disabled state, has something inside it selected, etc.  Often you want animations to execute when the user interacts with a control like this.

    One of the new things we are introducing with Silverlight 2 Beta2 is a "Visual State Manager" (VSM) feature that makes it much easier to build interactive control templates.  VSM introduces two basic concepts that you can take advantage of within control templates: "Visual States" and "State Transitions".  For example, a control like Button defines multiple visual states for itself - "Normal", "MouseOver", "Pressed", "Disabled", "Focused", "Unfocused".   When in template editing mode in Blend, designers now have the ability to easily edit what the button looks like in each particular state, as well as setup transition rules to control how long it should take to animate when moving from one state to another.  At runtime Silverlight will then dynamically run the appropriate animation Storyboards to smoothly move the control from one state to another.

    What is nice about this model is that designers do not need to write code, do not need to manually create animation storyboards, and do not need to understand the object model of controls in order to be productive.  This makes the learning curve for creating interactive control templates really easy, and means that existing graphic designers can very easily work on Silverlight projects.  Later this year we will also be adding Visual State Manager (VSM) support to WPF as well, which will let you use the same approach with Windows applications as well as share control templates between WPF and Silverlight projects.

    To see an example of this in action, let's add a Button control onto our design surface:

    We can then right click on the button and edit its control template. Instead of starting with the existing default control template (like we did with the slider example above), let's create an empty control template and start from scratch:

    Blend will prompt us for the name of the Style resource we want to create.  We'll name it "ScottButton" and click ok.  This will then put the designer in control editing mode for the Button, and start with an empty control template:

    One of the things to notice above is the new "States" window inside Blend.  This will show us all of the available "Visual States" that the Button control exposes.  Above the "Base" state is currently selected - which allows us to define the common visual tree of our Button control template. 

    We can then add some vector elements into our base state that defines the look of a custom button like below.  We could use the built-in vector drawing tool support provided by Blend to author these graphics, or alternatively use Expression Design or Adobe Illustrator to build the vector art and then import it into Blend.  Below we are adding 4 "Path" elements into our control template - one a rounded background (named "background"), one a drop shadow (named "shadow"), one a 40% opacity "shine" that adds a glow near the top, and one that defines the default inner content (in this case a picture of a house):

    Note: we could have alternatively imported an image, but using vector elements will give us the flexibility to scale/stretch/transform the button later and retain a crisp look and feel at any resolution or scale (particularly useful with Silverlight mobile scenarios - where screen resolutions might be different or smaller).  It will also allow us to easily animate/change any vector element within the artwork.

    Once we've finished designing our base state above, we can press F5 to run our application in the browser:

    As you can see above - our Button control now has a nicer look.  Despite its new look, the button still raises the same focus, click and hover events just like before - so a developer using the button does not need to change any code when working with a button that uses our new control template.

    One downside with our new button control template, though, is that it isn't interactive.  This means that I don't get any visual feedback if the button gains/looses focus, or if a mouse hovers over it.  I also don't get a nice depress/bounce-back animation when I click it.

    To add interactivity to our button, we'll return back to Blend and work with our Button's control template again.  Previously we added vector graphic elements to the "Base" state of our Button control.  This allowed us to define the default visual look of all visual states of our Button.  We can now go back and customize individual Button visual states further.

    For example, to implement a mouse-over behavior for our Button, we can select the "MouseOver" state in the "States" window, and then tweak the look of the button when it is in that state.  Below I've selected the "shine" vector element inside our control template and adjusted its Opacity property in the property grid to have it be more visible when in the MouseOver state.  Notice how Blend automatically highlighted the "Shine" element with a red dot and then listed the Opacity property below it in our objects window.  This makes it easy to quickly track all changes that we've made between the "Base" state and the "MouseOver" state in our control template:

    We can then select the "Pressed" state in the "States" window, and customize what a button looks like when it is pressed.  We'll change two things from the "base" state.  The first change is to make the "shine" element visible (like the MouseOver state). The second change will be to slightly offset the contents of the button control - while keeping the shadow element stationary.  This will give the button a nice "depressed" look and contrast nicely with its base visual:

    We can implement the offset change to the background, content and shine elements by selecting them in the designer, and then apply an offset render transform to them in the property browser:

    And now when we run our application again in the browser, we'll find that our Button now has interactive visual feedback when it is being used.  Below is the "normal" look of our Button:

    Hovering the mouse over the Button will then cause it to glow like below:

    Clicking the button will then cause it to depress and hide the shadow (it will then bounce back once the mouse button is released):

    Note that we did not have to write any code or XAML to change our Button's look and feel - the new Visual State Manager feature automatically handled moving between visual states for us. 

    By default Silverlight dynamically constructs and runs a transition Storyboard for you as you move from visual state to visual state (providing a smooth animation between the two states).  You do not need to write any code in order to make this happen (note: you do still have the ability to drop down and add a custom Storyboard transition if you want to, but for most cases you can probably use the automatic Storyboard transition).

    One feature you can take advantage of with Silverlight's automatic transition feature is to customize the time duration it takes for a visual state transition to occur.  You can do this by clicking the arrow to the right of a visual state and setup a rule that controls how long it should take the transition animation to run when moving from one particular state to another.

    For example, we could indicate that we want it to take .2 seconds to transition from the "Normal" to "MouseOver" visual state by adding the rule below:

    We can then configure this rule to take .2 seconds to transition between Normal->MouseOver like so:

    We can then click on the "MouseOver" state and setup a rule that causes the transition from MouseOver->Normal to take .4 seconds:

    Now when we re-run our application we'll have slower animation transitions for MouseOver scenarios, which adds a slightly smoother and more polished feel to our application.  We did not have to write a single line of code to enable this.  All controls shipped with Silverlight 2 will have built-in support for Control Template and Visual State Manager customization like above.

    To learn more about the new Visual State Manager and Control Template Editing features, please check out the tutorials here and here, and the videos on it here, here, and here.

    TextBox

    Beta2 includes some significant improvements to the built-in TextBox editing control.  Text scrolling with text-wrap, multi-line text selection, document navigation keys, and copy/paste from the clipboard are now supported.

    Beta2 also now includes IME Level 3 input support (including candidate window selection) for non-western character sets:

    Input Support

    Beta2 adds additional keyboard support in FullScreen mode (arrow, tab, enter, home, end, pageup/pagedown, space).  Note: full key input support isn't allowed to avoid password spoofing scenarios.

    Beta2 also adds new APIs to support inking and stylus input support.

    UI Automation and Accessibility

    Beta2 adds UI Automation Framework support into Silverlight.  UI Automation (or UIA) enables screen readers and other assistive tools to identify and interact with the components that make up your Silverlight 2 application.

    Beta2 uses the UIA framework and adds UIA based behaviors to an initial set of Silverlight controls.  By the final release of Silverlight 2 all controls will have UIA based behaviors built-in.  We will also add support for high-contrast scenarios.  These features will enable you to build accessible, section 508 compliant, applications.  This UIA support will also enable automated UI testing of applications.

    Animation and Graphic System

    Beta2 adds support for animating custom dependency properties.  Object animation support (animating structs) is also now supported.  Beta2 also supports the ability to create Storyboards in code that can animate parts of the render tree without having to be added to it (allowing you to embed animations entirely in code).  Per frame animation callback support will be added in the final release.

    Beta2 includes a new Visual Tree Helper static class that provides advanced visual tree inspection APIs.  It provides features such as the ability to enumerate children of an element and getting the ancestor/parent of a given reference element.  These APIs work against any UIElement you pass to it.

    DeepZoom

    Beta2 now supports an XML based manifest file for DeepZoom collections.  Beta2 also adds extensible MultiScaleTileSource support for DeepZoom (which allows developers to hook up existing image pyramids that don’t conform with the Deep Zoom format to the high performance rendering of Deep Zoom).

    WPF Compatibility

    Silverlight Beta2 includes a lot of fixes/changes to improve API compatibility between Silverlight and WPF (note: the final Silverlight release will contain some additional compatibility work as well).  We are also adding some new APIs we are introducing in Silverlight 2 to WPF in .NET 3.5 SP1 this summer.

    This work, combined with the VSM support we are adding to WPF later this year, will enable good code re-use across browser and desktop applications.

    Media Improvements

    Silverlight 2 Beta2 includes some significant Media related feature work:

    Adaptive Streaming

    Beta2 adds support for "adaptive streaming" - which enables you to encode media at multiple bit-rates and then have a Silverlight application dynamically switch between them depending on the network and CPU conditions.

    This enables much richer end-user media experiences - since it makes it possible for content providers to provide both lower-end and higher-end bit rate versions of a video, and then have Silverlight choose the optimal one to use based on an end-user's machine hardware and network capacity.  If while watching the video the machine or network conditions change, Silverlight can automatically switch to a more appropriate bit-rate without any buffering or interruption glitch.

    Silverlight's support for adaptive streaming is extensible - which enables anyone to plug-in their own logic to control where the media content comes from, and what bit-rate should be used.  This means that any CDN or media delivery provider can easily integrate their systems with Silverlight and deliver super high quality video delivery.

    Content Protection

    Beta2 includes DRM content protection, and supports Windows DRM and PlayReady DRM.  Both work cross browser and cross platform.

    Server Side Playlists

    Beta2 adds support for server side playlists (previous releases only supported client-side playlists). 

    Networking Improvements

    Silverlight 2 Beta2 includes a bunch of work in the networking space:

    Cross Domain Sockets

    Beta2 now enables cross domain networking support using both HTTP and Sockets (meaning your application can call sites other than the one the application was downloaded from).

    Silverlight will check for the existence of an XML policy file on target servers that indicates whether cross domain network access is allowed.  Silverlight supports a new XML policy file format that we've developed, as well as Flash policy files (which means existing sites open to Flash can be called from Silverlight without any additional work).

    Background Thread Networking

    Beta2 now allows Silverlight applications to initiate network requests on background threads, as well as process/handle network responses on background threads.  This enables a bunch of powerful scenarios, and allows you to avoid blocking the browser's UI thread while doing both HTTP and Socket network communication.

    Duplex Communication (Server Push)

    Beta2 enables support for setting up duplex communication channels with a WCF service on a server.  This enables a clean programming model that allows servers to "push" messages to Silverlight clients without the developer having to manually poll servers for changes.  This programming model is very useful in a variety of scenarios, including instant messenger/chat applications, and monitoring/update applications like stock tickers and trader applications.

    Web Services

    Beta2 enables significantly improved interop with SOAP based web-services.  Web service proxy class end-point URLs can now be configured without recompiling applications.  Visual Studio also now has a new "Silverlight-enabled WCF Service" project item template that you can add to ASP.NET web projects to publish services to clients.

    REST and ADO.NET Data Services

    Silverlight includes support for working with REST based web-services. 

    Beta2 adds support for calling and consuming ADO.NET Data Services (formerly code-named: "Astoria").  ADO.NET Data Services will ship as part of .NET 3.5 SP1 and makes it easy to publish data end-points within an ASP.NET web project that are consumable from any client using REST URIs.  Silverlight Beta2 now includes ADO.NET Data Service client support that allows you to easily call these services (and optionally use LINQ expressions within Silverlight to express remote REST queries to them).

    JSON

    Silverlight supports calling JSON-based services on the web. 

    Beta2 now includes LINQ to JSON support that enables you to easily query, filter, and map JSON results to .NET objects within a Silverlight application.  This makes it easy to call and work with existing AJAX end-points and services published on the web. 

    Data Improvements

    Silverlight 2 Beta2 includes a bunch of work in the data space:

    DataGrid

    Beta2 adds a number of new features to the DataGrid control. These include:

    • Auto-sizing support for columns and rows
    • Column sorting (with both single column and multi-column sort support) 
    • Column re-ordering support by end-users (allowing them to drag/drop columns to re-arrange the order)
    • Frozen column support (allowing you to prevent a particular column from being customized)
    • Performance and bug fixes

    DataBinding

    Beta2 adds more core data-binding features and better validation support.  These include:

    • Per-binding Validation and BindingValidationError event handler support on controls (allowing you to handle input validation with TwoWay bindings)
    • Support for binding expressions on attached properties
    • Richer binding value conversion support (including value conversion fallback support)

    Isolated Storage

    Silverlight enables applications to store data locally on a client (via a feature we call "Isolated Storage").  Applications can prompt users to grant them size permissions for this storage (for example: a user might grant an email program 50MB of local storage). 

    Beta2 increases the default local storage space provided to Silverlight applications to 1MB in size.  Beta2 also now provides better end-user support for managing per-site storage permissions, as well as the ability to easily revoke/delete an application's local storage.  Management UI to control this can now be brought up by an end-user by right-clicking on a Silverlight application and choosing the "Silverlight Configuration" menu option.

    Understanding Compatibility with Silverlight 1.0 and Silverlight 2 Beta 1

    Silverlight 2 Beta2 is compatible with applications that target Silverlight 1.0.

    Silverlight 2 Beta2 will not run applications that target Silverlight 2 Beta1, since we've made a number of API changes between the two betas for the new features being added in Silverlight 2.  Browsers that have Silverlight 2 Beta1 installed which visit a site that hosts a Silverlight Beta2 application will be prompted to upgrade to the newer beta of Silverlight.  Once they do this they won't be able to run Beta1 applications without uninstalling Beta2.  This means that if you have published a running sample on the web built with Beta1 you will probably want to update it to Beta2 soon. 

    We have published a document that details the changes between Beta1 and Beta2 here that can help with this.  I also recommend reading Shawn Wildermuth's What Changed in Silverlight 2 Beta2 and Upgrading your Silverlight 2 Projects to Beta2 posts for more details on some of the changes between Beta1 and Beta2.

    Summary

    To learn more about Silverlight 2 and download the Beta2 release, please visit the http://www.silverlight.net and http://expression.microsoft.com web-sites.  We'll be posting articles, tutorials, videos and more on both sites in the days and weeks ahead.  I'll also be posting some tutorials of my own here on my blog as well. 

    If you haven't already read them I'd also recommend checking out my previous First Look at Silverlight 2 and First Look at Expression Blend with Silverlight 2 blog posts that I wrote a few months ago when Beta1 shipped, since they provide a good overview of the Silverlight programming model and how to target it using both Visual Studio 2008 and Expression Blend.

    Hope this helps,

    Scott

  • May 20th Links: ASP.NET, ASP.NET AJAX, .NET, Visual Studio, Silverlight, WPF

    Apologies for the sparseness of my posting the last few weeks - work and life have been busy here lately.  Below is a new post in my link-listing series to help kick things up a little.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

    ASP.NET

    • ASP.NET Perf Issue: Large numbers of application-restarts due to virus scanners: Tess Ferrandez has a great post that details a debug session to determine why an ASP.NET application was restarting frequently (causing performance slowdowns).  The issue was a virus scanner that was causing files to be constantly updated.  Make sure to check out the logging code you can add to your application to identify restart causes like this.

    ASP.NET AJAX

    .NET

    • 7 Ways to Simplify your code with LINQ: Igor Ostrovsky has a great blog post that talks about new code techniques you can use to improve your code using .NET 3.5 and the new language and LINQ features in it.

    • Visual LINQ Query Builder for LINQ to SQL: Mitsu Furuta has created a cool Visual Studio designer that allows you to graphically construct LINQ to SQL queries.  Also make sure to download download the latest LINQPad utility - which is invaluable for learning LINQ and trying out LINQ queries.

    • Ukadc.Diagnostics: Josh Twist pointed me at a new CodePlex project he is working on that extends the System.Diagnostics features in .NET to include richer logging features (SQL trace support, email support, etc).

    Visual Studio

    Silverlight

    • Silverlight 2 Pie Chart: Peter McGrattan has posted a nice control and article that demonstrates how to use a new Silverlight charting control he has written.

    WPF

    • WPF week on Channel9: Watch 6 great videos on Channel9.  Each one includes interviews and demos with members of the WPF team talking about some of the awesome work that went into WPF 3.5 SP1 (read my blog post here for a summary of some of it).

    • WPF Testing and Application Quality Guide: Check out the 0.2 release of a free online book being developed by Microsoft that covers how to test WPF applications.  Definitely worth book-marking if you are doing WPF development.

    • WPF 3.5 SP1 StringFormat: Lester has a nice post that describes how to use the new StringFormat feature in WPF 3.5 SP1.  This makes it much easier to handle formatting of databound values.

    Hope this helps,

    Scott

  • Slides from my ASP.NET Connections Orlando Talks

    Last week I presented at the ASP.NET Connections Conference in Orlando.  I gave a general session talk on Monday, and then two breakout talks later that day.  You can download my slides+samples below:

    General Session

    The slides for my keynote can be downloaded here

    In the talk I demonstrated how to debug the .NET Framework source code.  You can learn how to set this up with VS 2008 here

    I also demonstrated building a site using the new ASP.NET Dynamic Data support - which you can learn more about here.  I also demonstrated using the new ASP.NET MVC Framework - which you can learn more about here.

    I also showed off the new Hard Rock Memorabilia site built with Silverlight 2.  You can try out the Hard Rock application yourself here.  You can learn more about Silverlight from my links page here.

    Building .NET Applications with Silverlight

    The slides + demos for Silverlight breakout talk can be downloaded here.

    You can learn more about Silverlight from my links page here.  In particular, I recommend reading my tutorial posts here and here.

    ASP.NET MVC

    The slides + demos for my ASP.NET MVC talk can be downloaded here.

    You can learn more about the latest ASP.NET MVC source refresh here.  Stephen Walther also just posted a really good set of slides + demos from his post conference tutorial on ASP.NET MVC here.

    Hope this helps,

    Scott

  • April 11th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight

    Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

    ASP.NET

    • 50 Useful CSS Tips and Tricks: A useful page that provides a nice listing of various CSS tips, tricks and tools you can use for common web scenarios.

    ASP.NET AJAX

    • Accessible UpdatePanel: Bertrand Le Roy from the ASP.NET team has an article that describes how to make the ASP.NET AJAX's UpdatePanel control accessible for screen-readers.

    • Building ASP.NET AJAX Components: Mike Ormond has written an excellent 8-part series that covers building re-usable ASP.NET AJAX components that work on both the client and server.

    ASP.NET MVC

    • ASP.NET MVC: Membership Starter Kit: Troy Goode has a built an awesome membership starter kit for ASP.NET MVC that provides registration and login pages for users to authenticate on your site, as well as a set of administration functionality that allows admins to create/manage users and roles.  Download it here.

    • How to Enable Pretty URLs with ASP.NET MVC and IIS6: James Geurts posts a useful article that describes how to enable extension-less URLs with ASP.NET MVC on IIS6 (note: you do not need to configure anything special with ASP.NET MVC on IIS7 to enable extension-less URL support).

    Visual Studio

    Silverlight

    • Dave Campbell's Excellent Silverlight Link Series: Dave Campbell posts a regular series of links to new Silverlight articles and content on the web.  I highly recommend subscribing to his blog if you want to stay current with all the latest Silverlight articles and posts.

    • Silverlight 2 Map / DataGrid Tutorial: Jason Zander has a great two-part Silverlight tutorial that demonstrates how to build a nice data-driven application that integrates a map control with a datagrid to filter and analyze data.

    Hope this helps,

    Scott