| Comments

This has been one of the features that I’ve been excited about for a while since I heard we were changing it.  With the release of Silverlight 2 Beta 2 and the updated preview of Expression Blend 2.5 (June 2008), skinning and styling controls within Silverlight gets a bunch easier.

Sample skins from Corrina Barber

When Silverlight 2 Beta 1 was released there was the possibility of styling/skinning controls.  It wasn’t impossible, but perhaps a bit obfuscated to the eye for people with short attention spans like myself.  You can read more about those methods here and here.  WPF designers were probably laughing that Silverlight developers might have been struggling with skinning controls.  Why?  Because Blend for WPF supports a right-click “Edit Template” functionality for WPF…so where is it for Silverlight?  In the latest release of Blend 2.5 of course!

That’s right—simpler skinning.  At RIApalooza in fact I was asked about how one would know *what* elements could be skinned, etc.  Outside of the docs, and some spelunking, it wasn’t entirely intuitive.  But now, well, let’s take a look.  Let’s take a look at Blend 2.5 June 2008 preview and adding a ScrollBar to our design surface:

You may not realize it but the ScrollBar has a lot of elements that you can skin.  The thumb, the handles, the bar, every little detail…so now in Blend 2.5 we can right-click and choose to edit that:

When you do this you are prompted for some settings, one to name the style and the second of where to put it, either in the document resources or as an application resource that other controls may subscribe to:

After you do this, your objects and timelines explorer (on the left by default unless you’ve moved it) now changes to represent the layered elements of the control you are skinning now.  Note that the “up” arrow will get you out of this mode and back to your documents visual tree of elements.  Here’s what the base template for ScrollBar looks like:

You can continue to dig further.  For example with ScrollBar, if you wanted to modify the Thumb, simply select that in the visual object tree:

then right-click on the Thumb now on the design surface and choose to edit that template and now you’ll see that you can edit the Thumb’s template rather simply:

If I wanted to I can remove the three elements that make up the HortizontalThumb and make my Thumb an Image of myself (horrible design, but proving a point):

I chose ScrollBar in this post, but you can do this with any of the controls and the process is the same.  This now makes skinning a bit more within a closer reach to most.  The reach for developers might be a bit further if you have no design skills…but I’ll gladly send you my picture if you want to use it as your navigational Thumb for ScrollBar.

One other tip is that when you have an element on the design surface that has a template skin attached to it, Blend will help you get there even faster rather than having to right-click further.  At the top there is a breadcrumb like trail and if you are on an element that has a template there will be a “Template” link you can click directly on:

Hope this helps!

| Comments

So you want to read an RSS/Atom feed on the interwebs and saw the SyndicationFeed class you could use in Silverlight to give a nice RIA display of the syndicated data.  Great, no problem right, just wire up an WebClient, point it to the RSS feed on something like http://silverlight.net or something and boom, done.  Wait, what’s this 404 Not Found error?  In most cases this is going to be a result of a cross-domain issue.  If you haven’t started working with services yet, Silverlight requires a cross-domain policy file to be in place to access remote data not on the same site-of-origin of the Silverlight application.

If you want to learn more about this in further detail you can read this and view this.

Crap.  So now what do you do?  You don’t have a server that would enable you to write a proxy service and you don’t really have the time to do that.  Aha, enter some free services for you!

Popfly

First, depending on what you are trying to do with the data, give Popfly a look.  Popfly contains several templates for importing syndicated information and displaying it in different visualizations.  For instance in about 4 clicks I can import an RSS feed, connect it to a visualizer and have this:

Popfly is no longer available as a service from Microsoft.

Feedburner and Yahoo! Pipes

Pipes is similar to Popfly but doesn’t really provide a breadth of possibilities of visualizations and ease of mashup of way different types of sources, but for this purpose I think it works well.  In Pipes, you can create an input feed and map it to an output, even merging various sources together.  The end result can be a new RSS feed for you.  And Yahoo Pipes already has a cross-domain policy file in place for Flash (which Silverlight supports).  You have to change your endpoint URI a little bit and it wasn’t clear until I searched, but for example, here is a RSS feed URL you could use for combining my blog and the Silverlight community blogs in one.

Feedburner is a syndication service that does a lot of statistics of your feed, helps you manage subscriber data and can save you some bandwidth as well.   It does RSS really well (and enclosure support, etc).  Best of all, it also supports cross-domain policies via the Flash format (again, which Silverlight supports). 

So if you find a feed that is on a site without cross-domain policy support, you can create a new Feedburner feed, Yahoo Pipe or Popfly mashup and be good to go!

A subtle workaround for getting data from sites that aren’t providing the policy files :-)

Hope this helps!


This work is licensed under a Creative Commons Attribution By license.

| Comments

I’ve seen this issue a few times with people using the Manage Videos portion of Silverlight Streaming to directly upload a video file to be hosted.  Now with direct endpoints to the WMV files I’m seeing it a bit more.  Let me see if I can shed some light on this situation.

First, there is a distinction between uploading an application to Silverlight Streaming versus just a video.  What I’m going to discuss here is working with video only uploads.  If you didn’t know, you can directly upload just a video and Silverlight Streaming will host that file and create a Silverlight player experience for you as well (if you want it).

Okay, now on to the issue.  It is important to note that there are specific size limitations of videos with Silverlight Streaming services.  If you are trying to go beyond those size limitations your issue could be that right away.  The video file size must be smaller than 105MB.  Moving on…

Some of you may have attempted to upload a video and then directed to the page that shows the video processing and seen a “Video cannot be processed” message. 

Your issue could be related to what I’ll explain here.  It’s a bug.  We released the Silverlight Streaming transcoding (upload video turnkey only) service when Expression Encoder 2 was not yet released.  When Encoder 2 shipped, we realized that it wasn’t playing nice (the outputs rather) with the transcoding service.  We have to fix this and are working on it.  If you are taking a video source, running it through Expression Encoder 2 and then trying to upload that resulting video, you may be hitting this issue.

One thing to note, is that the “upload video” is a transcoding service.  So if you already have a VC-1 (or Silverlight capable) media format WMV, there really is no need to use the upload video portion.  You already have a high-quality encoded format and don’t need to transcode that again.  So how do you get it up there if this issue exists?  A few ways.

Option 1 – Upload an Application with a manifest

You can package the video file up with an application and use the Manage Applications functionality to upload that content.  You can use one of the Encoder templates if you’d like as well.  Even though you may not need the extra files, that is okay, because you can still have an endpoint to your WMV if that is what you want.  Since we don’t have the Silverlght Streaming Publish plug-in for Expression Encoder 2 complete yet (it is coming), here is a workaround on how to create those packages.

Option 2 – Upload the file direct with the API

While maybe not flexible for some, you can upload the file as an application directly using the API which doesn’t require a ZIP format for this purpose.  More information on the methods and API you would need can be found here.  The API is a WebDAV-based API for managing applications.

Option 3 – Name your WMV file to ‘video.wmv’ and upload as an application

Before you do any operation rename your file to ‘video.wmv’ and then go to the Manage Applications area of Silverlight Streaming.  Create a new application and give it a name, then in the next screen upload the ‘video.wmv’ file you just renamed.  After completion you can go to the Manage Videos section of the administration site and see your video.

We understand this may be a problem for some of you and are doing our best to address it as soon as possible.  Please note this is only an issue for Expression Encoder 2 file outputs that are attempting to be uploaded via the Silverlight Streaming transcoding service (aka Manage Videos) section.

Hope this helps!

| Comments

Hot off the press, a new drop of Windows Live Writer was just released.  Get it here.  This is one of my favorite tools from Microsoft and the update brings a few new changes.

First, I’m happy to report that Flickr4Writer and S3Browser still work fine and require no adjustments.  The other thing announced today from the Writer team is an updated SDK.  This new SDK includes a new type of plugin which enable plug-in activity for pre- and post-publish events.  Some of you following me on Twitter may have noticed something every so often that said “blogging: blah blah” and a link to the post.  This is done automatically for me from Writer using a plug-in.  It actually is one of the ones included in the updated SDK (along with another example for adding a Digg badget to your post).

Recently there’s been some discussion of people re-aggregating/posting blog content to other sites.  Even though I had a Creative Commons license on my blog’s footer, etc, it wasn’t in my content so when someone re-posted my stuff automatically, it wasn’t visible.  Using the new Writer SDK, I created a quick little plug-in that would add a notation about the Creative Commons license I was using to every post.  Again, automatically now and I don’t have to write anything.  I’m making this one available for free/test and you can get it here.  These plug-ins are accessed in the same way through the Tools…Options menu in Writer.  Here’s the configuration for mine:

If you click the Preview tab (a new feature in Writer preview – tabs instead of menu options to switch between Edit, Preview, Source), it will show you what it will look like as well.  These types of plugins can also be enabled per weblog so if you have more than one weblog defined for Writer, you can choose which one you want these post- and pre-publish event plug-ins to be turned on for. 

For some existing plugins out there, this is a more natural fit.  When I heard about this new model, I joined up with Alexander Groß who wrote the Now Playing plug-in which is awesome and flexible (he’s also involved in a great Graffiti template for user groups).  But it seemed a more natural fit to use this model of automatically appending the information instead of having the user remember to click the button to insert the information.  I’ve submitted my changes to Alexander and hope they make it into his next build of Now Playing.  It looks the same in config and here it is in preview mode in Writer:

I love the new Writer with the subtle changes it has made and the additional plug-in model.  Get your update today!

| Comments

I'm Speaking at Mix Essentials - La Esencia de la Web - 5 de junio, 2008, México, D.F. This week I’ll be traveling to Mexico City to meet developers and designers at the local MIX Essentials (English translation here – funny that RIA gets translated to LAUGHS) event.  I’ll be presenting two sessions there this week.  I was fortunate enough to be asked to kick-off the conference talking about building RIAs with Silverlight 2.  I’m particularly excited about this as I have some things to show that haven’t really been shown broadly yet.  I will also be speaking on working with data in Silverlight 2 later in the day.  This session will cover working with services, servers, sockets and LINQ as a part of Silverlight development.

I hope that all those near Mexico City and around will be able to join us at this event.  If you are planning on being there, I look forward to meeting you and getting feedback on Silverlight as well as seeing what really interesting things are being developed in Mexico.  See you soon!