PDX baby.  That’s where I’m headed next week.  The Portland area user experience group (a SIG formed out of the Portland .NET user group) is hosting a Silverlight 2 launch party next week (11 NOV 2008).  They’ve invited me to attend and share some fun stuff about Silverlight 2.  I’m very excited to be going there because Portland is one of my favorite towns.  It has some of the best public transportation there and I think that makes for a great downtown experience and a lot of personality in the city.

Aside from the city itself, there are some great folks that will be there: Jason Mauer, Erik Mork, and Kelly White.  Maybe we can convince Hanselman to show up as well?  There will be dinner provided by Microsoft I’m told and then we’ll show some Silverlight stuff.  What will I be talking about?  I think I’ve decided to show a couple things:

    • Accessing data with Astoria
    • Building “traditional” line-of-business applications
    • Silverlight offline applications

There will also be some demo station areas after the main presentation where myself, Erik, Kelly and Jason will be showing some other stuff or to answer questions.  I’m seriously hoping there is some Rock Band action there so I can show my Chop Suey skills on the guitar.  If there isn’t, I know there will be a great group of folks to geek out with anyway.

So if you are in the area (or if you’re not, consider a short drive), please join us on 11 NOV @ 6:30 PM Pacific for the November meeting of the PDXUX group.  You can find all the details and a map to the location on the PDXUX web site.  Please also visit the registration site to RSVP your intent to come so that their planning team can estimate accordingly.  I’m looking forward to talking with some Portland developers about Silverlight and getting some feedback!

Hope to see you there!

I’m sorry, but the link you clicked on or the page you were looking for couldn’t be found here.  I’ve tried my best to maintain all the permalinks on this site since I started it in 2003.  For the most part everything should be here, but it seems you’ve hit an area that I couldn’t find.

I’d encourage you to perform a search by starting here with Live search and adding your term into the search box.  You may also visit the archives or view the tag listing (it’s verbose, but you may find what you are looking for) to find a starting point.

If you still cannot find what you are looking for from my site, please feel free to reach out and contact me.  I’m usually immediately responsive if I’m available and have various ways to contact me.

I hope that you find this site valuable to you and ask that you consider subscribing to my site with your favorite RSS reader or you may also subscribe through email.

I received a comment regarding the new Expression Encoder SP1 Silverlight player templates and how they can be used within your own application.  Right now the templates appear to stand on their own.  That’s only because the output of an Encoder action will be an encoded file, the template you chose (XAP) and an HTML page to host the Silverlight player application.

But what if you already have an application and are trying to integrate media playback within it?  How can you take advantage of the Encoder templates, but just drop them in your existing application?  Let’s take a quick look.

Let’s say we have an existing application.  For the sake of this post, let’s just show some primitive controls and display a Button and TextBox within some StackPanel layouts:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     >
   7:  
   8:     <Grid x:Name="LayoutRoot" Background="White">
   9:         <StackPanel Orientation="Horizontal">
  10:             <StackPanel Height="Auto" Width="309">
  11:                 <Button Content="Button"/>
  12:                 <TextBox Text="TextBox" TextWrapping="Wrap"/>
  13:             </StackPanel>
  14:             <StackPanel Height="Auto" Width="250" x:Name="MediaArea"/>
  15:         </StackPanel>
  16:     </Grid>
  17: </UserControl>

Now we want to add a media player using the Encoder templates to our application in the StackPanel labeled MediaArea.  First, we need to get the media player from the template as a control.  Easy enough since the source code for the Expression Encoder Silverlight 2 templates are included.  Browse to your install directory for Expression (usually C:\Program Files\Microsoft Expression\Encoder\Templates\en\) and pick the Silverlight 2 template you want to use.  NOTE: This is only for Silverlight 2 templates, so be sure not to get frustrated at me :-) -- you’ve been forewarned.  I’ll choose the SL2Standard template.  Notice within that folder there is also a Source folder.  Within there is an ExpressionPlayer folder and associated C# source code project.  Open that project in Visual Studio 2008.

Now build the project.  Done.  You now have a control you can use.  Here’s how we’ll do it.

Going back to our own application we need to add a reference to the ExpressionPlayer.dll and MediaPlayer.dll we just built.  Go ahead and do that in your Silverlight application by choosing Add Reference and then pointing to the assembly location.  Now we need to inform our XAML that we’ll be using this control.  Of course if you add these controls to your Visual Studio 2008 toolbox you can drag-and-drop them onto the XAML code surface and it will append the xmlns attribute for you, or we can add it ourself:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     xmlns:expression="clr-namespace:ExpressionMediaPlayer;assembly=ExpressionPlayer"
   7:     xmlns:ExpressionMediaPlayer="clr-namespace:ExpressionMediaPlayer;assembly=MediaPlayer"
   8:     >

I’ve called my namespace “expression” and “ExpressionMediaPlayer” and you can see I’ve pointed (actually Visual Studio’s Intellisense did it all for me) the namespace to the assembly I just referenced.  Now we can use the control.  Here’s the XAML for adding it to my application and adding a media file that is in my applicaiton:

   1: <UserControl
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     x:Class="ExPlayer.Page"
   5:     Width="640" Height="480" 
   6:     xmlns:expression="clr-namespace:ExpressionMediaPlayer;assembly=ExpressionPlayer"
   7:     xmlns:ExpressionMediaPlayer="clr-namespace:ExpressionMediaPlayer;assembly=MediaPlayer"
   8:     >
   9:  
  10:     <Grid x:Name="LayoutRoot" Background="White">
  11:         <StackPanel Orientation="Horizontal">
  12:             <StackPanel Height="Auto" Width="309">
  13:                 <Button Content="Button"/>
  14:                 <TextBox Text="TextBox" TextWrapping="Wrap"/>
  15:             </StackPanel>
  16:             <StackPanel Height="Auto" Width="250" x:Name="MediaArea">
  17:                 <expression:ExpressionPlayer Width="242" Height="177">
  18:                     <expression:ExpressionPlayer.Playlist>
  19:                         <ExpressionMediaPlayer:PlaylistItem MediaUrl="Lake.wmv"/>
  20:                     </expression:ExpressionPlayer.Playlist>
  21:                 </expression:ExpressionPlayer>
  22:             </StackPanel>
  23:         </StackPanel>
  24:     </Grid>
  25: </UserControl>

Of course you can interact with it via code as well, but getting the control in your app is easy once you know these steps.  Now my application has a fully-functional media playback without me writing any code and being able to integrate it within my existing application.  I might want to change the style of course to fit my application’s experience, but dropping in a few style attributes wouldn’t be that difficult…and I an always make that a part of the Encoder template as well!  Here’s the “after” screenshot of it in play:

You get full functionality out of the player…with one exception.  I’ve noticed that the fullscreen option doesn’t act the same as if the player was the only app.  To be honest I haven’t looked at what it would take to do that,but remember that now the media player is a part of a bigger app and isn’t the application itself.  So “fullscreen” mode is a part of the container Silverlight application and not just the media player…something to watch out for if you expected your embedded media player now to automatically have the same fullscreen functionality.

The other day I wrote a simple little Silverlight application using a DataGrid to help navigate the TechEd DVD contents.  My code was admittedly quick and dirty.  I loaded up some data, and based on some events re-filtered and re-bound that data.  After thinking about it I am not sure why I didn’t just use some existing controls to help me do that work.  I found that AutoCompleteBox from the new Silverlight Toolkit would do this for me.

One thing that the AutoCompleteBox does quickly is provide filtering for simple string data.  But what about custom types?  My data in the TechEd application has a List<TechEdSession> where TechEdSession is respresented as such:

   1: public class TechEdSession
   2: {
   3:     public string DiscNumber { get; set; }
   4:     public string SessionCode { get; set; }
   5:     public string Track { get; set; }
   6:     public string SessionTitle { get; set; }
   7:     public string Speakers { get; set; }
   8:     public string TechEdConf { get; set; }
   9: }

If you wire up the AutoCompleteBox.ItemsSource to my List<> nothing will happen.  Why?  Well the control doesn’t know how to understand the data exactly.  So we have to help it.  It knows the data is there but doesn’t know what to return based on the filter.

This is simply done using the ItemFilter property on the control.  We can easily provide a Lambda expression to help the control understand the filter.  After setting the ItemsSource property to the results of my LINQ query, I add the expression to help the control understand the data:

   1: SessionFilter.ItemsSource = sessions;
   2: SessionFilter.ItemFilter = (search, item) =>
   3:     {
   4:         TechEdSession session = item as TechEdSession;
   5:         if (session != null)
   6:         {
   7:             string filter = search.ToLower();
   8:             return ((session.SessionCode.ToLower().Contains(filter) || 
   9:                 session.SessionTitle.ToLower().Contains(filter) || 
  10:                 session.Speakers.ToLower().Contains(filter)) &&
  11:                 session.TechEdConf.ToLower().Contains(((ComboBoxItem)ConfSelector.SelectedItem).Content.ToString().ToLower()));
  12:         }
  13:  
  14:         return false;
  15:     };

That’s it.  I’ve now defined the filter for the control so as the user types data it does the appropriate filtering logic and displays the results.  I’ve chosen to still display the results as a DataGrid for easy reading in this application, but could have also used an ItemTemplate if I desired.  The ItemFilter expects a search predicate to be passed to it.

So the resulting application has the same capabilities, but a lot less code for me to write.  Here’s the ending result:

So if you need to implement AutoCompleteBox and have it search/filter your custom types, be sure to supply your own ItemFilter to help the control know where to look!

Thanks for all the feedback on the TechEd North America DVD issues with viewing the content once Silverlight 2 released.  In trying to do a good job providing a good user experience to viewing the content easily, the TechEd team created a Silverlight 2 Beta 2 player for the TechEd Online site as well as the offline DVD content.

Obviously, when Silverlight 2 released and people installed the final version on their machines, the DVD Silverlight player stopped working and presented you with an “Install Silverlight” badge.  This was, of course, due to the use of Beta 2.  This doesn’t render the DVD set useless as the content is still there, but you just aren’t able to use the Silverlight player from the DVD.

The team has updated the player in the online version of the content already.  Unfortunately you can’t service burned DVDs (aside from burning new sets and sending them to the thousands of people, which isn’t efficient, cost effective or environmentally friendly), but we can help you understand the maze of content folders.  We’ve finalized the document that maps out where the content files are as well as providing you with a “content map” of the codes to the session descriptions and the speakers who delivered the sessions.  This list was made based on your feedback and the team tried to include as much information as they could to make it easy to discover.  You can download a PDF copy of this content map here: TechEd 2008 North America DVD content map.

I’ve also taken the liberty to make a quick Silverlight application to help you do some quick filtering of the data.  It’s uploaded into Silverlight Streaming so you can embed it into your site or as well into your Intranet if your employees or others in your organization are needing to navigate the DVD set as well.  You can select which conference (Developer or IT) and also type some filter in there that will search the speaker/title and filter it down.

In hindsight, choosing to burn a copy of a Beta 2 application to a distributable disc was not a good idea.  We admit that and apologize.  Hopefully you can see that the content is the king here and that is not lost or unusable.  Thanks for your patience while we created the content map based on your feedback!