WP7 Silverlight Gotcha: Setting the Source on a MediaElement will stop background music playback

Applies To: Silverlight (the restriction applies to XNA, but the MediaElement is only Silverlight) Quick Bits Simply setting the Source of a MediaElement to a valid source will stop any current background playback, causing you to fail Marketplace certification, according to section 6.5.1 from the certification guide. The Fine Print From the certification guide: 6.5.1  Initial Launch…

1

WP7 Gotcha: Showing a Launcher or Chooser will crash while Navigating

Applies To: Silverlight & XNA (anyone using Launchers / Choosers) Quick Bits Always wrap [some launcher object].Show() with a try/catch block which catches InvalidOperationException, since running Show() while navigating (for example, if the user clicks your button multiple times quickly in succession) will cause this Exception to be thrown. The Setup You have a button…

2

WP7 Perf Tip #4: Use fully qualified paths when setting the source property

File this one under “Sad, but True”… Take Away’s: Always prefix your source paths with a “/” (full-qualified path) instead of simply using relative paths. Correct: <Image Source=”/Resources/Images/Background.jpg”> Incorrect: <Image Source=”Resources/Images/Background.jpg”> But they both work!?! True, both of these will work, equally well (visually), but performance wise the relative path will do extra lookups which…

0

WP7 Silverlight TextBoxes No Longer Scroll

There’s a change in the pipeline that will be hitting the public Windows Phone 7 images at some point soon (post the current Beta), which removes the ScrollViewer from a TextBox’s template. What does this mean? Basically, long TextBoxes will no longer scroll when you gesture over them – the gesture is ignored and there is…

0