Advertisement

Smashing Magazine September 2010 Windows 7 Theme

September is here (apologies for being late - in all honesty I wasn't inspired by this months' selections)…time for an updated Windows 7 Smashing Magazine theme pack!

Smashing Magazine September 2010 Windows 7 Theme

The September themes seem to be continuing the focus on 'summer' things.  So here is your September 2010 Windows 7 Theme Packs for wallpapers – unfiltered and uncensored – about 75 wallpapers in all.

For details on these and to see past ones, visit the Smashing Magazine Windows 7 Theme information for the specifications I used for the theme pack as well as previous themes.  Want to participate and submit yours?  Join in!


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

Silverlight, HTML5 and the future

The Silverlight team today posted some information about what the future holds for rich Internet apps and where we have come with SIlverlight, where we see HTML5 playing a role and how Silverlight will be a part of the future of this next evolution of rich Internet apps.

Brad Becker, Director of Product Management, provides some information behind the value of Silverlight in a world where HTML5 will also co-exist:

Expect to see more from Silverlight in these areas especially in our focus scenarios of high-quality media experiences, consumer apps and games, and business apps.

When you invest in learning Silverlight, you get the ability to do any kind of development from business to entertainment across screens from browser to mobile to living room, for fun, profit, or both. And best of all, you can start today and target the 600,000,000 desktops and devices that have Silverlight installed.

I would encourage you to go and read “The Future of Silverlight” (frankly which I think should be titled The Future Includes Silverlight) as it provides some good information about what exists today, capabilities of platforms and where these technologies can grow into in the future.  Be sure to leave comments for Brad on the post as well!


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

Silverlight 4 service release (September 2010)

Today we released an update to Silverlight 4 (update build is 4.0.50826.0) along with an updated SDK.  We appreciate our customers’ patience on working with us to help identify and verify necessary updates to this service release.  You can find all the details in KB2164913.  Here are the relevant highlights:

  • SDK feature to enable Add New Row capabilities in DataGrid control
  • Improving startup performance of Silverlight applications
  • Adding mouse wheel support for out-of-browser applications on the Mac platform
  • Various media-related fixes around DRM content
  • Fixed memory leak when MouseCapture is used
  • Fixed memory leak for DataTemplate usage

All the installer links have been updated to leverage these new bits for our customers.

For end users

For end users, having them simply install the runtime will provide them with the updated bits and benefits of the fixes/features in this service release.  The best way to force encourage your users to upgrade to this service release would be to leverage the MinRuntimeVersion attribute of your object tag:

   1: <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
   2:     width="640" height="400">
   3:     <param name="source" value="YOUR_PATH_TO_XAP" />
   4:     <param name="background" value="white" />
   5:     <param name="minRuntimeVersion" value="4.0.50826.0" />
   6:     <param name="autoUpgrade" value="true" />
   7:     <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50826.0" style="text-decoration: none">
   8:         <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
   9:             style="border-style: none" />
  10:     </a>
  11: </object>

Notice lines 5 and 6 above.  This would trigger that the end user is required for your application to run and require them to upgrade. The minRuntimeVersion/autoUpgrade are the minimum to require your user to upgrade to the later version.  Ideally you would follow good installation experience guidance (see “Installation Experience Whitepaper” with complete sample source code) to customize your install and/or upgrade experience.

For Developers

If you are a developer and authoring Silverlight applications you may want to grab the new developer bits and updated SDK:

I would install the developer build first and then the SDK and you’ll have a refreshed environment.  As with any release we try to get you the information as soon as possible and sometimes the information flows faster than the download servers replicate.  If you aren’t getting the updated bits using the links above, please be patient as the download servers from Microsoft refresh their replication caches. 

Note that when you now create a new project you’ll be using the new SDK and so the minRuntimeVersion (see above) of the project templates as well as compiled bits for your SL4 application will be using/requiring the updated runtime.

There are NO Visual Studio tools updates for this release so the Silverlight4_Tools.exe package is not needed to re-install.

For Visual Studio LightSwitch Users

When Visual Studio LightSwitch shipped they included a pre-release later build of Silverlight 4.  This caused some issues for customers who were using a single machine to evaluate LightSwitch but also using the same machine.  Any Silverlight 4 application developed and deployed would give customers messages indicating that they needed a later version of Silverlight, but were unable to acquire a compatible version!

This is now solved with this service release.  Simply put: If you are using LightSwitch, install the updated developer runtime and SDK.  This will solve this issue and allow you to develop LightSwitch applications as well as production Silverlight 4 applications.

Hope this helps!  As always if you have feedback on Silverlight, here are some methods of providing feedback to our team.


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

My new Kindle 3 review–comparing against Kindle 2

When I first saw the Kindle 3 (is that even the new name?) was going to be offered with WiFi, I thought that was cool.  Then when I saw the price (USD $139) I figured it was a no-brainer to explore.  I had bought my wife a Kindle 2 a while back ($249 when I purchased it) as she is a reader and I thought she’d like it.  She does.  It turns out though, so do I!  I’ve found myself reading a LOT more lately and I really like the versatility this provides me in switching between books.  (If you are interested in seeing what I’m reading or just finished you can see my list on goodreads.com.)

Anyway, back on to the Kindle 3.  I just got mine today and wanted to share my first impressions/comparisons.  By no means is this an exhaustive review, but I compared for my own edification and thought I would share.

First Impressions

Amazon’s packaging of the Kindle since their first versions are great.  The self-contained box is awesome…unzip the recyclable cardboard and there it is.  No additional box to open.  It’s simple, and puts the focus on the device.  The box includes 3 things: Kindle, power cord and a user guide (that I almost mistook for a Field Notes large notebook).  The new device is compact, well-designed and attractive.  My first impressions were very good.

Power-on experience and WiFi connectivity

I powered it on and was instantly ready to go.  The user guide popped up with some initial information.  Having had a Kindle before, I ignored it all of course.  The next screen encouraged me to register the device and change the device name.  Before I could do that I needed some level of connectivity.  My home has two stories and my wireless router is upstairs behind a structured wiring panel.  For my laptop, mobile devices, etc. this hasn’t been a problem.  It isn’t the strongest signal, but it has done well.

The Kindle saw the wireless network fine and showed an adequate representation of signal strength.  I entered my password (WPA2) and it failed to connect.  And then I entered it again and it failed.  And again.  Then I tried “manual” and essentially just verified the information and clicked connect (my WPA2 password was already filled in the manual registration based on previous attempts).  This time it connected.  My gut tells me that the WiFi antenna isn’t the strongest on the Kindle device, so keep that in mind where you plan on using it.  I don’t see this as a huge issue as generally when you’d use it you are likely to be in a good range.  But so far my experience is that the range is much less than normal for Kindle than for other traditional devices.

Transferring content

There was an option for “transfer” of existing data (email profile and data).  Since I was planning on keeping both of them I chose to skip that.  There was an option to transfer Collections created from another device.  It showed me my device list, I selected it and the collections were transferred.  Simple.

Hardware

The hardware is physically smaller than the Kindle 2:

If you look at the second picture above you’ll see how they were able to reduce some width and height.  NOTE: While I’m sure there are some millimeter measurement differences in the thickness, I found it to be negligible…the blind eye wouldn’t notice much of any difference.

I tried to line up the screens (which is the same size) so you could see where the reduction is.  The keyboard keys are spaced the same amount apart (again maybe millimeter closer), but notice the removal of the numbered keys.  That eliminated an entire row from the keyboard.  On the width side of things, the next/previous page buttons are no longer labeled and are much thinner – this is noticeable, and welcomed.  There is now matching next/prev buttons on both sides of the Kindle so no matter how you hold it. 

The home, menu and back buttons are moved into the keyboard area along with a d-pad like replacement of the Kindle 2’s knob, again a welcome replacement in design and usability for me.

The Kindle 3 also seems to weigh a slight bit less and I think this is due to a more plastic design than the metal backing on the Kindle 2.  I like the new Kindle material as it feels a little less industrial and more stylish. 

Software

One of my nags about the Kindle is not in the reading responsiveness, but rather in interacting with the menu system, the store, and navigating the device.  I was pleasantly surprised on the new Kindle 3 at the speed and responsiveness in everything I interacted with.  For me, this was very noticeable improvement on my previous experience.  The Kindle 2 isn’t bad, but it’s like driving a 200 horsepower engine after just driving a 550 horsepower engine.  The former isn’t bad and is adequate, but now that you’ve had more power, it’s hard to enjoy the adequacy. 

I think that this will greatly improve my overall experience on the device and for others.  The knob on the Kindle 2 may actually be the issue as I’ve always felt a delay in response after issuing a command.  Not so on Kindle 3 as interaction with the d-bad/arrows has been immediate for me.  Page turning comparisons between Kindle 2 and 3 is about the same in my book.  I want to believe the new one is faster, but honestly I can’t tell much of a difference.  It wasn’t bad for me before.

The software on the Kindle 3 reads “3.0” whereas my Kindle 2 is 2.5.6 right now so understandably there are some differences.  Perhaps the Kindle 2 will get an update that results in better responsiveness.

Browser

This was the biggest surprise to me.  The browser (which is actually in the “experimental” area of the Kindle OS) on the Kindle 2 sucks.  It barely works.  Lynx is a better browsing experience.  Seriously.  Knowing this I fired it up on the Kindle 3.  Wow.  I was impressed.  Here is Amazon’s home page on Kindle 2:

and on Kindle 3:

Most other sites are able to render well also.  Sure it is still monochromatic, but I don’t expect to be watching Hulu or anything on my e-reader.  It’s a primary-purpose device for me with ancillary benefits…and a MUCH better browser is a welcome experience for the few times I’ve actually wanted/needed to use it.  Bravo Amazon, bravo.

Wireless connectivity

Now the Kindle 2 always came with “3G” connectivity…that was the only wireless option.  The Kindle 3 offered a new option, WiFi only (in addition to WiFi+3G for a larger price).  I chose the WiFi only one because the times I’ve actually used the wireless connectivity (to buy a new book and to sync pages for my other reading devices) has been in areas where I would have had WiFi anyway.  The cost savings made it even easier of a decision.

The WiFi seems adequate speeds when connected to an access point in good range.  Again, this isn’t as big of deal for me because I don’t use it that much.  My Kindle 2 sucked down battery like crazy when I kept wireless on.  I’m keeping WiFi on my Kindle 3 initially to see the battery life.  Honestly though, unless I’m actually interacting with connectivity, I turn it off anyway…there isn’t a need for it on otherwise in my opinion.

Summary

If you’ve been holding back on getting a Kindle, the $139 WiFi only version just released should remove most, if not all, barriers in your decision.  For what you are getting on that price in an e-reader is amazing.  Sure I can get an iPad for 3x the cost and have Kindle on that, but I’m not sure it would make a good e-reader as a primary purpose device.  Also, take a look at this comparison of quality for reading purposes between iPad and Kindle.

UPDATE: Look at the microscope comparison of quality from Kindle 2 to Kindle 3

My initial impressions of Kindle 3 as a previous Kindle user are awesome.  I’m impressed above the existing device I have and would recommend Kindle 3 to anyone on the fence about getting one.  If you think it is an iPad competitor, then you won’t be happy with it, but compared to other reader-specific devices out there, the price, the design and the available library of books is unmatched.  Go buy it now.


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

Storing and playing media on Windows Phone 7

In talking with a friend about some Windows Phone 7 and Silverlight stuff recently.  He was giving me some great feedback about a few things (all of which I’ve passed along).  One of the things was what I felt was a common task that might exist in the mobile space but admittedly isn’t as clear if you are just coming to WP7 development.  The scenario is that of downloading media files and storing them for later playback.

WP7 does not have a storage mechanism like SQLLite on the device, but since it is Silverlight, you do have Isolated Storage you can use leveraging the same .NET class libraries from the full framework.  Here’s a sample app that demonstrates downloading an MP3 and storing for later playback on Windows Phone 7.

The Scenario

First, to make the scenario clear, say you are building a specific app for your brand’s media archives (audio and/or video).  You want to enable the user to selectively (or automatically) download the media to their device.  You want the user to be able to playback the downloaded media while offline later.  The media in this scenario is an MP3 file, a common audio format.

The Pieces

In order to do this we’ll assume the following:

  • You have an absolute URI to the MP3 file.
  • You have some type of UI to display to the user a list of media for your application
  • Some type of UI to control the playback (play/stop/etc.)

For demonstration purposes my UI will not be very ‘user friendly’ as it is meant to be diagnostic in explaining the task.  I will have a ListBox that I’ll use to bind to the list of downloaded items, a TextBox to give an option to download an MP3 file, and three (3) buttons: Download (to fetch the file and store for later), Play and Stop.  Here is the XAML I’ve used starting with the blank Windows Phone Application using the Windows Phone Developer Tools available to developers.

   1: <!--LayoutRoot is the root grid where all page content is placed-->
   2: <Grid x:Name="LayoutRoot" Background="Transparent">
   3:     <Grid.RowDefinitions>
   4:         <RowDefinition Height="Auto"/>
   5:         <RowDefinition Height="*"/>
   6:     </Grid.RowDefinitions>
   7:  
   8:     <!--TitlePanel contains the name of the application and page title-->
   9:     <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,9,0,40">
  10:         <TextBlock x:Name="ApplicationTitle" Text="AUDIO SAMPLES" Style="{StaticResource PhoneTextNormalStyle}"/>
  11:         <TextBlock x:Name="PageTitle" Text="MP3" Margin="9,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
  12:     </StackPanel>
  13:  
  14:     <!--ContentPanel - place additional content here-->
  15:     <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
  16:         <TextBlock Height="67" HorizontalAlignment="Left" Margin="6,6,0,0" Name="textBlock1" Text="Showing how to store and playback MP3 files on the device." VerticalAlignment="Top" TextWrapping="Wrap" />
  17:         <ListBox Height="150" HorizontalAlignment="Left" Margin="6,79,0,0" Name="listBox1" VerticalAlignment="Top" Width="444" />
  18:         <ProgressBar x:Name="DownloadProgress" IsIndeterminate="False" Style="{StaticResource PerformanceProgressBar}" Margin="6,-60,0,0"/>
  19:         <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,298,0,0" Name="textBlock2" Text="URL to download" VerticalAlignment="Top" Width="175" />
  20:         <TextBox Height="72" HorizontalAlignment="Left" Margin="0,334,0,0" Name="mpsUri" VerticalAlignment="Top" Width="460" Text="http://files.sparklingclient.com/099_2010.07.09_WP7_Phones_In_The_Wild.mp3" />
  21:         <Button Content="DOWNLOAD" Height="72" HorizontalAlignment="Left" Margin="12,399,0,0" Name="button1" VerticalAlignment="Top" Width="438" Click="button1_Click" />
  22:         <Button Content="PLAY" Height="72" HorizontalAlignment="Left" Margin="12,477,0,0" Name="button2" VerticalAlignment="Top" Width="220" Click="button2_Click" />
  23:         <MediaElement Height="43" HorizontalAlignment="Left" Margin="6,555,0,0" Name="mediaPlayback" VerticalAlignment="Top" Width="438" />
  24:         <Button Content="STOP" Height="72" HorizontalAlignment="Left" Margin="230,477,0,0" Name="button3" VerticalAlignment="Top" Width="220" Click="button3_Click" />
  25:     </Grid>
  26: </Grid>

You can see that I’m not using any advanced pattern development here for two reasons: 1) it doesn’t need it and 2) I want to focus on specific tasks to isolate this learning.  Therefore if you don’t like Click handlers in your Button XAML, then you can flog me later :-).

Downloading the media

The first step in my sample is to download some media.  I’ve chosen a favorite podcast, the Sparkling Client as my sample file.  I hope they don’t mind.  In fact you may want to pick a small MP3 file to test on one of your servers so you don’t have to wait a while for the download to complete.

SIDE NOTE: I like how Sparkling Client has become more of short review of the times with regard to Silverlight.  Good to see some perspectives (and rumors).  It’s like a live version of Dave Campbell’s Silverlight Cream.

Because typing long things in the emulator is, well, annoying, I’ve prepopulated the URI TextBox (mpsUrl) with a specific URL.  Feel free to change this or enter a new MP3 URI in the emulator.  The next step is to execute the download.  I’m choosing to use WebClient.OpenReadAsync in this regard.  It’s simple and gets the job done.  Admittedly I wish that there was an OpenReadDownloadProgress argument available (as there is for DownloadStringAsync) but there is not. 

Because there is no actual progress value provided for me, I do want to provide the user some feedback that something is happening.  To do this in my sample I am using Jeff Wilcox’s “High Performance ProgressBar” for Windows Phone 7.  I’m not going to go into the details of why and how to hook it up – read his post.  I followed the exact same instructions. 

NOTE: When using the progress bar, don’t (only) set Visibility to collapsed if that is one of your mechanisms for displaying/hiding it, but be sure to set IsIndeterminate to false when not using it.

When I start the download, I start the ProgressBar to show the user some type of feedback that something is happening.  Here’s the code for the function:

   1: private void button1_Click(object sender, RoutedEventArgs e)
   2: {
   3:     string fileName = System.IO.Path.GetFileName(mpsUri.Text);
   4:  
   5:     // start the download of the MP3
   6:     WebClient wc = new WebClient();
   7:  
   8:     wc.OpenReadCompleted += ((s, args) =>
   9:         {
  10:             DownloadProgress.IsIndeterminate = false;
  11:  
  12:             // once get the streams, put in isolated storage
  13:  
  14:         });
  15:  
  16:     wc.OpenReadAsync(new System.Uri(mpsUri.Text, System.UriKind.RelativeOrAbsolute));
  17:     DownloadProgress.IsIndeterminate = true;
  18: }

And here’s a quick screenshot of what it looks like running:

Windows Phone 7 progress bar

Simple enough…let’s store the downloaded bits now.

Storing the media to IsolatedStorage

The result of OpenReadAsync is a Stream.  Using IsolatedStorage and specifically IsolatedStorageFileStream, I can write out those bits to a file that is stored in my device’s storage location.  Normally in the browser Silverlight world I would have to calculate the amount of storage needed, see if it is available and, if not, request a quota increase to the user.  I don’t have to do that in the phone world.  I can just begin to write out the data.  Ideally, however, I should check for available space since it is entirely possible the user has used all their storage.  This sample does not accommodate that logic.

In my OpenReadCompleted event I add the following logic:

   1: // snipped
   2: wc.OpenReadCompleted += ((s, args) =>
   3: {
   4:     DownloadProgress.IsIndeterminate = false;
   5:  
   6:     // once get the streams, put in isolated storage
   7:     using (var store = IsolatedStorageFile.GetUserStoreForApplication())
   8:     {
   9:         if (store.FileExists(fileName))
  10:         {
  11:             store.DeleteFile(fileName);
  12:         }
  13:  
  14:         using (var fs = new IsolatedStorageFileStream(fileName, FileMode.Create, store))
  15:         {
  16:             byte[] bytesInStream = new byte[args.Result.Length];
  17:             args.Result.Read(bytesInStream, 0, (int)bytesInStream.Length);
  18:             fs.Write(bytesInStream, 0, bytesInStream.Length);
  19:             fs.Flush();
  20:         }
  21:     }
  22:  
  23:     RefreshIsoFiles();
  24:  
  25: });
  26: // snipped

You can see that I’m writing out the file stream to a file using the same name as the MP3 file literally (which may not make sense to the user, so again this is one of those ‘polish’ areas you’d want to make better and perhaps organize the files in IsolatedStorage better).

The last step you see is a call to RefreshIsoFiles.  This is a function that I also call when the first user interface page is loaded.  It traverses the IsolatedStorage for the app to display the already stored media in the ListBox in our XAML:

   1: private void RefreshIsoFiles()
   2: {
   3:     string[] fileList;
   4:  
   5:     using (var store = IsolatedStorageFile.GetUserStoreForApplication())
   6:     {
   7:         fileList = store.GetFileNames();
   8:     }
   9:     listBox1.ItemsSource = fileList;
  10: }

Now we have our data downloaded and ready for playback.

Playing back the stored media

So great, now you have a stored MP3 file and you want to play it back.  Remember the XAML above and that I have a MediaElement there.  MediaElement is so simple at playing back media files from a URI.  Simply set the source of MediaElement and you can then call Play() and other functions. 

UPDATE: Well, you learn something new always.  Corrado pointed out below in comments that in WP7 you can SetSource directly to an IsolatedStorageFileStream...so while the following is interesting, it doesn't appear to be required in WP7 :-).

The challenge is that we now have our media in IsolatedStorage and there isn’t a URI scheme for IsolatedStorage that is predictable to the developer.  What we are left with is opening the media as a Stream and feeding that to the MediaElement.  This introduces MediaStreamSource.  If you aren’t familiar with this API, you’re probably not alone.  This is the API that enables a few scenarios, namely Smooth Streaming playback for Silverlight.  It is an extensible API so that you could wrap your own decode logic, etc. as needed.  Now given that MP3 is a common format you’d think it would be simple to do this…but there isn’t one built-in method for these various different codecs.

When MediaStreamSource was introduced, the program manager on that feature had written some helper files as code samples for developers to use.  One of them was an MP3 MediaStreamSource helper.  I wrote about them and where you can get them: MediaStreamSource for Silverlight.  Here’s where some awesome code re-use comes in to play.

I downloaded the ManagedMediaHelpers project and built the Mp3MediaStreamSource project (which also builds MediaHelpers).  In my WP7 project I simply added a reference to these in my project.  I was able to use these Silverlight binaries directly in my WP7 project! (I’ve included the compiled binaries in this sample for convenience but you can also see the source link in the article above.)

Now I need to read the media from IsolatedStorage as a stream, feed that Stream into my MediaStreamSource, and set that as the source for my MediaElement.  Here’s the relevant code on the Play button on my sample:

   1: private void button2_Click(object sender, RoutedEventArgs e)
   2: {
   3:     if (listBox1.SelectedItem == null)
   4:     {
   5:         MessageBox.Show("choose an item to play back!");
   6:     }
   7:     else
   8:     {
   9:         using (var store = IsolatedStorageFile.GetUserStoreForApplication())
  10:         {
  11:             audio = store.OpenFile(listBox1.SelectedItem.ToString(), FileMode.Open);
  12:             // play it back as a MSS
  13:             mss = new Media.Mp3MediaStreamSource(audio);
  14:             mediaPlayback.SetSource(mss);
  15:         }
  16:     }
  17: }

The media now plays back on the phone.  My Stop button basically closes the stream (audio and mss are member variables of the project) and nulls out references.

Summary

This is I think what might be a common application scenario for WP7 (downloading media for playback later).  Hopefully over time our platform will improve to make some of this better (i.e., progress indication), but for now this should help those get started on this task.  The meat of the solution is in the MediaStreamSource implementation.  If you are working with MP3 format, then the sample code will help you greatly as it’s mostly done!  There are other implementations floating around for WAV and other things as well if you need them.

Hopefully this might nudge Chris along the right path and be a helpful tip to others as well.  If you have any feedback on the implementation or a better way of doing this, please share!  Here’s the solution bits to my sample in full: Mp3StoreandPlayback.zip.

Hope this helps!


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

Debugging Silverlight with Visual Studio and Firefox

Suppose you use Firefox as your default web browser and you are a Silverlight developer using Visual Studio.  You may have been frustrated at times in being able to get the debugger to attach to your breakpoints.  You’ve triple-checked that you are in debug mode, that the Silverlight checkbox is marked in the hosting web application’s property pages and it still is not breaking for you.  You stare at the dreaded empty red circle in Visual Studio reading the tooltip of “No debug symbols have been loaded…” a thousand times.

But it works in Internet Explorer.

I’ve faced this a few times and always forget the tip.  I’m recording it for my own posterity, but hopefully it will help others as well.

Here’s how to ensure the VS debugger attaches to the Silverlight app for debugging:

  • In Firefox address bar type about:config
  • Read the warning, choose your preference to always remind you or not and accept
  • In the search bar of the config options now type: npctrl
  • You should then see the entry: dom.ipc.plugins.enabled.npctrl.dll
  • Change the value from true to false (simply double-clicking will change this for you)
  • Restart Firefox

And your debugging should come back to normal.  It has frustrated me more than once.  Hopefully it helps some others.


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

Pano versus Pivot: Windows Phone Design Days content available

One of the biggest discussions I started getting into when Windows Phone development was announced to the world was sparked with this single question I posed to our internal Windows Phone developer teams:

What is the use case for when you would want to use a Pano versus Pivot application layout?

I asked this in the context of an application for Yelp that I was writing.  Information was similar but not identical.  It was only similar in the sense that the data was all about user reviews and venues.  In my eyes I saw this like the fact that games are similar in that they are games, but their individual information (the play) is different.

I guess I was expecting a definitive or clear view on when to use either given my use case I presented.  I laughed as I collected numerous various viewpoints from all areas of the dev platform folks.  It was clear there was no clarity for me.  I actually have saved the most concise definition the discussion generated and had been wanting to blog about it for a while.

Today, Jaime released a bunch of videos from a ‘design days’ event that was held in Redmond for Windows Phone developers.  They are all great, but there was one that caught my eye: Windows Phone Design Days – Pivot and Pano.  In this video a few UX researchers walk through some of the key tenets of each control.  Here’s some of my mental notes:

Pivot

  • Application view manager
  • Filter same data on different views (the “inbox” is a great example of this)
  • Optimized for current screen size
  • Filter of data doesn’t have to be same view (agenda/day)
  • Related content is ok to pivot on as long as related content is truly related
  • Focused

Panorama

  • Horizontal broad canvas, not confined to current screen size
  • A ‘top layer’ view into underlying experiences/tasks
  • Exploratory in nature
  • Don’t use if you need an application bar
  • Don’t have a pano that takes the user to a pivot control constantly
  • Leverage things inherently interesting (use ‘about me’ type information)
  • Never place a pano *in* a pivot

There was some good information in this video (like don’t use pivot/pano for wizard-based UI) and one of the better descriptions/examples of answering my root question.  The other videos are great and I encourage you to take a look at them.

I’d encourage you to take a look at all of these videos to get a good sense on some of the user experience research done for Windows Phone developers and how you can learn to target a great experience in your app/game.


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

StringFormat and CurrentCulture in Silverlight

I recently got a note about a nagging issue in using StringFormat in XAML binding expressions and how it doesn’t honor the current user’s culture settings.  This is true that there is an issue in that it doesn’t in WPF or Silverlight.  If you don’t know what I’m talking about, Silverlight introduced the ability to use StringFormat in data binding expressions (WPF has had this since 3.5 SP1) so you could do some formatting in-line in your binding.  Like this:

   1: <TextBlock Text="{Binding Path=CurrentDate, StringFormat=Current Timestamp is: \{0:G\}}" />

This would result in text that would be formatted directly using your string Formatter without the need for code-behind or any generic ValueConverter.  This is a very helpful feature for formatting UI values as well as in some cases replacing ValueConverters for simple tasks.

The problem is that StringFormat isn’t honoring the user’s culture settings.  Take for example this complete XAML:

   1: <StackPanel x:Name="FooContainer">
   2:  
   3:     <TextBlock x:Name="CultureInfo" />
   4:     <TextBlock x:Name="UICultureInfo" />
   5:  
   6:     <TextBlock Text="{Binding Path=CurrentDate, StringFormat=Current Timestamp is: \{0:G\}}" />
   7:  
   8:     <TextBlock x:Name="CostField" Text="{Binding Path=Cost, StringFormat=Cost is: \{0:c\}}" />
   9:  
  10:     <toolkit:GlobalCalendar  />
  11:  
  12: </StackPanel>

This is being bound to a simple object that exposes two properties for the purposes of demonstration: CurrentDate (DateTime) and Cost (double).  Using my standard US-English settings and regional preferences the output would be:

StringFormat with default culture

Now, let me tell my Silverlight app that I have a different culture information.  I can do this without having to force a language pack installation of sorts and completely change my machine.  Adding the culture/uiculture params to the <object> tag does the trick.  I’ll change it to “de-de” for German.  Here is the new output:

StringFormat with explicit culture

What?!  Even thought the settings recognize a different culture, StringFormat is not doing what I expect.  I would have expected a different date display for German settings (d.m.yyyy) and a different currency display instead of dollars.

Unfortunately this is an issue in StringFormat right now, but there is a simple workaround that if you are creating a localized app you can add to your code that shouldn’t affect your default language settings either.  In my constructor I add this line of code:

   1: this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);

This tells the markup system to use the current culture settings as the UI language.  XmlLanguage is a part of the System.Windows.Markup namespace, so ensure you call that out explicitly or add a using statement.  Now refreshing my German settings sample I get:

StringFormat with explicit culture

as expected.  Changing (or removing the explicit setting of culture in my <object> tag) back to my default culture settings results in my US-English preferences being used and no need for me to change the XAML.

Hope this helps!


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

Smashing Magazine August 2010 Windows 7 Theme

August 1st is here (well okay, so I'm a little late)…time for an updated Windows 7 Smashing Magazine theme pack!

Smashing Magazine August 2010 Windows 7 Theme

The August themes seem to be continuing the focus on 'summer' things.  So here is your August 2010 Windows 7 Theme Packs for wallpapers – unfiltered and uncensored – about 35 wallpapers in all.

For details on these and to see past ones, visit the Smashing Magazine Windows 7 Theme information for the specifications I used for the theme pack as well as previous themes.  Want to participate and submit yours?  Join in!


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

Microsoft PDC10 Announced–Book hotel early

So it appears we’ll be having a Professional Developer’s Conference after all this year.  Today we announced the PDC10.

Microsoft PDC10

Unlike previous ones in ‘conference cities’ this one will be held at the source of the information, on Microsoft’s campus in Redmond, Washington.  The price looks to be less than previous as well, so check out the details at the Microsoft PDC event site.

If you’ve never been to Redmond before, or if you have, allow me to give you some friendly advice.  If you think you might be coming, book a hotel room now.  Redmond isn’t a conference city like LA, Atlanta, New Orleans, etc.  That means there isn’t massive amounts of 50-floor hotels sprawling all over the place.  Here’s my tips (as a former frequent traveler TO Redmond) on where to stay.  This is my own personal advice based on experience.

NOTE: While some addresses may be in Bellevue, if you aren’t familiar with the area, know that Microsoft’s main campus in some areas spans the two cities (Bellevue/Redmond). 

Here’s some hotel options for you:

  • Homestead Suites – this is THE closest hotel to the main campus.  I’ve stayed here once.  And frankly I haven’t stayed since.  My experience is just one, but it wasn’t a positive one.  I know others who have stayed here with no issues though and enjoyed the stay.  These are suite-style rooms with a kitchenette usually and don’t have daily maid service.  It is relatively inexpensive though and good for a budget.  If you want to be CLOSE to main campus (i.e., you could walk to conference center), this is the place.  That being said, there is no night life :-).
  • Fairfield Inn, Courtyard by Mariott, Residence Inn Bellevue – these places are literally in the same parking lot.  It isn’t right on campus, but will be the next closest ones.  If you wanted to walk to campus you could, but it would be a healthy walk.  I almost always stay at either the Courtyard or the Fairfield.  They are clean, roomy, and have the amenities I desired.  I don’t think you can go wrong with any of these choices.  The Residence Inn provides rooms that are more suite-like for sharing with groups of folks.  These are all reasonably priced in the area.  Not a ton of nightlife around here either.
  • Redmond Mariott Town Center, Residence Inn Redmond – these are right next to each other as well and in the Redmond Town Center area – which is closer to downtown Redmond.  Town Center is like an outdoor retail mall/shopping center with restaurants, shopping, movie theater, etc.  It’s a good place if you need something around you.  Not everything is open always after hours, but better chances here walkable than other places.  This is not a walkable location to campus though.
  • Redmond Inn and Silver Cloud Inn – these are two other off-brand hotels that are in Redmond that a lot of business visitors use.  They are economical and generally no issues.  I’ve stayed at the Silver Cloud before and have had no issues with it.  The Redmond Inn is close to campus and you could walk if needed to.  These are more budget hotels.
  • The Heathman Hotel Kirkland – my favorite place to stay if you don’t mind not being in Redmond.  This place defines service.  Kirkland is a town just west of Redmond and would be a drive to campus (about 10 mins with no traffic).  The hotel is in downtown Kirkland which has a pretty decent local nightlife (weather permitting).  They have a courtesy driver that will take you places as needed (not sure if they will drive you daily to the conference center, but you might ask if you have a group).  It’s a modern, more contemporary hotel.  When my family comes to visit, if I don’t have room, I’m telling them to stay here.

There are others, of course, but I don’t have experience in them.  My guess is these will fill up fast.  Then you will be looking at downtown Bellevue (a drive) for a place or – worse – Seattle, which would not be ideal for a conference goer (but if you want nightlife, then stay in Seattle).  My guess is that the conference may be providing shuttles from certain hotels but I haven’t heard anything myself. UPDATE: I just heard no shuttles on this one, so my recommendation is pick close to campus or find a MSFT buddy who can pick you up :-).  Seattle metro area has great mass transit as well though!

I would recommend booking early if you want to be close to campus.  I’m sure these will sell out VERY quickly.  Redmond/Bellevue/Kirkland is a very diverse area with lots of multi-cultural eating locations and natural/organic food options as well (if you want Pho, check out Saigon City on Bel-Red Rd).

Hope this helps and see you at PDC10!


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

First time here? You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting! (hide this)