| Comments

I’ve been working on some stuff around templates lately and had my own opinions of some of the value of certain features of the Visual Studio template functionality.  What I’m speaking of here is when you choose File…New Project or on an existing project Add Item.  Both of those show you a list of templates.  When you select one most typically you get new files in your project.  It is one area of Visual Studio that is the simplest to extend and provide specific templates for your developers.

There is an option for template developers to specify what, if any, files are open by default once the template is added.  Using Silverlight as an example, when you create a new project you’ll see that the default MainPage.xaml file is opened for you in the designer.  I wanted to get a feeling of what developers thought of this functionality.  Help me with some research?

This is, of course, totally un-scientific and I just wanted to get a litmus test of what people thought of that functionality (opening files by default, not just the concept of templates). Thanks in advance for helping out!

| Comments

Last night after a quick e-mail exchange with Phil, David and Scott I revised my Silverlight Toolkit “NuPack” packages I had previously created when NuPack NuGet first came out.  At the time there were a couple of things still not supported and frankly, I got busy and never bothered to check back.  Scott had seen something on a forum inquiring why Silverlight stuff, namely our open source controls, aren’t deployable via NuGet.  There wasn’t any other reason other than resources not currently scheduled to add this to the build flows, etc.  So I spent a few minutes revising the packages and putting them up there:

Silverlight Toolkits on NuGet

What you see above is the “Add Library Package Reference” results after you install NuGet.  Now instead of having to install an MSI, etc. you can basically add a reference to the package and the bits will be copied to your project and automatically referenced.  In order to componentize the main Silverlight Toolkit, I created the NuGet packages in a way that they can be individually consumed, or a meta-package as “All.”  It’s cool that NuGet allows you to create a meta-package which is basically a dependency graph.  For instance, my “all” package has zero content…but here is the .nuspec contents:

   1: <?xml version="1.0" encoding="utf-8"?> 
   2: <package> 
   3:   <metadata> 
   4:     <id>SilverlightToolkit-All</id> 
   5:     <version>4.2010.04</version> 
   6:     <authors>Microsoft</authors>
   7:     <description>The complete Microsoft Silverlight Toolkit.  Details at http://silverlight.codeplex.com</description> 
   8:     <language>en-US</language>
   9:     <licenseUrl>http://silverlight.codeplex.com/license</licenseUrl>    
  10:     <projectUrl>http://silverlight.codeplex.com/</projectUrl>
  11:     <dependencies>
  12:       <dependency id="SilverlightToolkit-Core" version="4.2010.04" />
  13:       <dependency id="SilverlightToolkit-Data" version="4.2010.04" />
  14:       <dependency id="SilverlightToolkit-DataViz" version="4.2010.04" />
  15:       <dependency id="SilverlightToolkit-Input" version="4.2010.04" />
  16:       <dependency id="SilverlightToolkit-Layout" version="4.2010.04" />
  17:       <dependency id="SilverlightToolkit-Theming" version="4.2010.04" />
  18:     </dependencies>
  19:     <title>Silverlight Toolkit - All</title>
  20:     <owners>Tim Heuer</owners>
  21:     <iconUrl>http://silverlight.microsoft.com/assets/sl-32.png</iconUrl>
  22:     <tags>silverlight toolkit sltoolkit</tags>
  23:   </metadata> 
  24: </package>

It’ basically defines the pointers to what it needs and NuGet does the magic to manage the dependencies on install.  For the Silverlight for Windows Phone Toolkit, we also have icons.  NuGet allows me to package up those icons as well so that when the package gets added, so do the icons (NOTE: there is still a step to mark them as content in the project).  I point this out because when the phone toolkit first came out some of the samples weren’t working for people because they didn’t read that they had to actually include some icons to get them to work.  Using NuGet, at least we’re able to help them even further.

I really like this model.  I love that I can use a familiar “Add Reference” gesture in Visual Studio, but I can also use a PowerShell VS window to do my package management as well if I wanted.  Take a look at the NuGet stuff and if you are a Silverlight developer, now you have everything easily at your fingertips!

NOTE: The version numbers in the toolkit packages are package version numbers.  We’ve never really promoted the toolkit versions as they literally are (i.e., 4.0.31319.blah) but rather as the release timeframe i.e., “April 2010” release.  Because NuGet follows CLR versioning taxonomy I created the package versions to hopefully be somewhat descriptive: 4.2010.04 – For Silverlight 4, April 2010 release – as an example.  It’s not perfect, but it works.

NuGet has over 670 packages now in the repository with an amazing set of tools readily available at your fingertips.  There are some good Silverlight nuggets in there as well and it is nice to have our toolkits in there now also!  When updates come out, the Library Package Manager will show the updates, giving the developer the option to update them quickly.

Hope this helps!

| Comments

Just a quick shout-out to congratulate the latest Silverlight MVPs to the program.  The Microsoft MVP (Most Valuable Professional) program is a recognition program that is in place to recognize and reward those individuals who have been identified by individuals (peers, Microsoft staff, etc.) as experts in their technology field and global contributors to the technology. 

Microsoft MVP logo

As of today (01 OCT 2010) we welcome some new folks to the Silverlight group:

All of these folks are great participants in the Silverlight ecosystem and their local geographies and I congratulate them for their efforts.  Be sure to check out all the Silverlight MVPs and subscribe to their blogs!  Thanks to all of you for helping make a great developer ecosystem!


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

| Comments

On the heels of the Windows Phone Developer Tools and Silverlight for Windows Phone Toolkit releases I saw a lot of exhaling going on in the hallways today.  Apparently Jeff saved his largest one for an avalanche of knowledge on Twitter in the late afternoon.  Jeff Wilcox is a developer on the Silverlight team and has been working on the Silverlight for Windows Phone initiative as well as the toolkit released today.  He was headed out on vacation but decided to throw out some words of wisdom for Windows Phone developers working in Silverlight.  Here’s some of those nuggets – I wanted to capture them before he left because who knows how long they’ll stay in Twitter.  It reads like a true guide to developing great apps on Windows Phone…

  • Panorama looks nice, but Pivot will offer faster start time.
  • You can also set a Background image to a Pivot. You won't get the parallax effect, but it is another option.
  • Be aware of how many pano and pivot items you do have. Memory expands quick when you have a lot of views and images!
  • Even if you have a 30k compressed JPEG image, at runtime that becomes an uncompressed surface that may take several MBs of memory
  • Pivot and Panorama can have UI element headers and titles, too, but you'll need to apply your own styling (fonts and sizes)
  • Beware that UI elements larger than 2000x2000 pixels that are bitmap cached clip on Windows Phone 7. We know it isn't perfect, but beware k?
  • Setting SelectedIndex before the items are set on a Pivot causes an exception. Wrap in a try/catch or wait for loaded (sorry!)
  • A slideshow app in 5 minutes: Pivot with null Header and Title and item headers. Beware memory use though.
  • A lot of people try building 'wizard' screens with panorama & pivot control. Please don't do this! Thx, the "UX gods"
  • Layout is a killer. But like death, you eventually have to pay it for everything.
  • So consider delay loading controls and screens. A Panorama with a billion items will take forever to load due to layout.
  • If you're not using PerformanceProgressBar, I'll send @JustinAngel after you ProgressBar for Windows Phone 7
  • If your app rocks and starts really quick *on a device* consider not using a splash screen
  • It's true. Your 6-core machine running the wp7 emulator is NOT indicative of device (single core!) performance. Beware!
  • We've talked perf before... Content over Resources for images means fast startup time http://bit.ly/9DhVbd
  • If you're using Panorama, a Resource background will load immediately compared to Content
  • Remember that for ingestion to the marketplace, your apps need to consume under 90MB of memory
  • However on devices with > 256MB, its cool to use more *in those cases
  • long deviceTotalMemory = (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory");
  • long applicationCurrentMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage");
  • long applicationPeakMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage")
  • Your compositor thread should rock out around 60fps all the time please. #wp7dev perf counters: http://bit.ly/busJIi
  • If your UI thread gets pegged, your compositor thread will suffer... remember your BackgroundWorker kids!
  • Unfortunately the "Analytics" type from desktop Silverlight is not on the phone today, so you can't measure CPU in a regular app
  • Having a single DispatcherTimer in your app can affect your battery life regardless of interval. Chose wisely
  • You can set the Foreground property on Pivot to set the title and header text color
  • Using a map control inside a Panorama or Pivot is not recommended for a number of UX and technical reasons. Navigate to a subpage.
  • Please use text styles and never hardcode sizes or default fonts.
  • The panorama/pivot items expect most their contents to have a 12px margin left/right for UX reasons. The default styles have this.
  • So if you have something in a pano/pivot item with 0 margin & padding, your UX will be funky
  • Fill rate is super important. Keep it under 2.5 please
  • What is fill rate? 1.00 means one screen of pixels being rendered every frame.
  • Check your apps for extra, un-needed background colors on pages, controls, etc.. They impact perf.
  • That sexy "tilt" effect? Use Peter's behavior http://bit.ly/90Z1yR and/or check out the MSDN docs
  • DataTemplates with a bunch of StackPanels and Grids? Try to simplify to a Grid with the right col/rows instead for perf wins.
  • Unit testing in a quick and dirty way is possible on the Windows Phone thx to the sl unit test fx. http://bit.ly/a0DWah
  • Only use Dispatcher.BeginInvoke when you must. Look at SmartDispatcher (ps old code sry) http://bit.ly/axHh36
  • For a "wide" Panorama item, set the item's Orientation to "Horizontal"
  • Play with the cache and redraw vis. settings to see what's being cached in your app http://bit.ly/busJIi
  • Things in a list/scroll viewer are often automatically bitmap cached by Silverlight for Windows Phone runtime
  • If you have a progress bar with IsIndeterminate="True" in your app, even if its hidden those storyboards are costly! Set to False!
  • We did work on Windows Phone 7 to move more networking to the background thread - hope it helps
  • When a Panorama loads, all its items go through a render pass. For pivot, it is done incrementally for neighboring items.
  • When making web requests, see if the service lets you scope down the fields that are returned for quicker perf (and JSON over XML!)
  • If you navigate to a subpage, the old page will stick around - so complex pano/pivot pgs stay in memory unless you're proactive
  • The "app deployment tool" installed with the dev tools lets you run others apps in emulator/device without needing source
  • We optimize for loading some things from isolated storage. Images from an isostore stream may load faster than a MemoryStream
  • If your source files have "Black" or "White", you might be doing it wrong. PhoneForegroundBrush, PhoneBackgroundBrush instead!
  • If your control's dep. property has a change handler, animating that prop. will always happen on the UI thread (no gpu accel.)
  • Animating Opacity on a CacheMode="BitmapCache" element = compositor thread (GPU!)
  • In the RTM tools, scroll viewers all have the "bounce" effect automatically
  • If you ignore the phone's theme (and go all light bg, like the mail app), your scrollbarsmust be retemplated or you won't see them!
  • Although data binding is not evil, an observable col. with a complex data temp. and 200k items is evil.
  • The web browser control won't let you NavigateToString until it has loaded.
  • If you have an app with a lot of different web browser controls, think about consolidating to one, so it only has to load once.
  • Panorama is designed to be a starting place. Think whitespace. Not tons of data
  • Free performance win: when you use Panorama the way the UX guidelines recommend, it is faster! http://bit.ly/9zTxtU
  • Those theme xamls for #wp7? Yeah they are in %ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Design\
  • Resist the urge to Panorama every app.  It is a sweet UX thing when used right…but not just because.
  • Resist the urge to iPhone gradient your apps. Think outside the box! Also it avoids color banding...

So as you can see, he sort of knows what he’s talking about :-).  Go subscribe to his blog and follow him on Twitter.  Other helpful links:

Thanks Jeff for sharing your awesomeness!

Hope this helps!

| Comments

After a longer-than-should-have-been delay (you can blame me for that) allow me to introduce JetPack.

JetPack theme

I’m really excited about this theme and the work that our team put together here.  You may have see Tsitsi talk about theming in general and introduce this theme on Silverlight TV.  The challenge behind this theme was to take some of the excitement around other Silverlight themes and create a great looking overall theme that could be used for line-of-business applications, but also extended as desired by any other application.

Working with the team at Pixel Lab, our small team looked at areas of inspiration from various online and client applications that are popular and what worked well about the user interaction on those themes.  Robby and team did a great job in my opinion of creating a very well designed theme that can be used in almost any circumstance.

During this September refresh of the themes we’ve also updated the previous 3 themes: Cosmopolitan, Windows and Accent Color with some minor fixes and tweaks based on some feedback we got.  You can see a preview of the various styles in JetPack here.

We hope you enjoy JetPack as much as we do!  We’ve provided the theme pack in the same way as we have the others, as templates for Visual Studio 2010 and Expression Blend 4 and the raw assets (resource dictionaries) for you to download.  Each Visual Studio template is build for modeling the Silverlight Navigation Application template and the WCF Ria Services Business Application template.  We’ve provided the VSIX installer formats so you just need to download that, double-click and you’ll have them in your File…New Project window for selection.

Thanks for your patience through the release of JetPack, there were some moving parts in the end (mostly delays in our release management system which underwent some changes) that were human-caused [blame me] but we’re glad to finally get it out in the wild!  Download all the themes here.

Hope this helps!