Data binding User Settings in Windows Phone applications
The canonical example of user settings is a “Show this welcome screen at startup” checkbox so that your application can offer a nice out-of-box experience.
By writing a simple type with some properties, adding a few helper files, and setting up a two-way data binding, you can store any settings without having to write special code.
Here’s what the completed project’s two-way data binding looks like for the checkbox:
- <CheckBox
- IsChecked="{Binding Source={StaticResource MySettings}, Path=IsFirstRun, Mode=TwoWay}"
- Content="Show this page at startup"
- />
- Source is a static resource, a strongly typed settings class you define
- Path points to the property name to bind to
- Binding is two-way so that the value is stored automatically
- Value and type converters can be applied as always in bindings if necessary
Creating your configuration/settings type
Next, we need to create a strongly typed configuration class that derives from my SettingsProvider type. This class must:
- Implement INotifyPropertyChanged, so that bindings work well
- Have properties of the appropriate type for the settings you are interested in. Optionally, include the DefaultValue attribute to provide defaults.
- using System.ComponentModel;
- using JeffWilcox.Settings;
- namespace Sample
- {
- /// <summary>
- /// My settings class for storing application data and setting specific to
- /// the user.
- /// </summary>
- public class MySettings : SettingsProvider
- {
- private bool _isFirstRun;
- private string _hello;
- public MySettings() : base("MySettings.xml") { }
- [DefaultValue("What's up?")]
- public string HelloWorld
- {
- get { return _hello; }
- set
- {
- _hello = value;
- NotifyPropertyChanged("HelloWorld");
- }
- }
- [DefaultValue(true)]
- public bool IsFirstRun
- {
- get { return _isFirstRun; }
- set
- {
- bool old = _isFirstRun;
- _isFirstRun = value;
- if (value != old)
- {
- NotifyPropertyChanged("IsFirstRun");
- }
- }
- }
- }
- }
Via Jeff Wilcox – Data binding user settings in Windows Phone applications
A few Quick Start Videos for Windows Phone Development
Via Getting Started with Silverlight and Windows Phone 7 Development
A guide to what has changed in the Silverlight 4 RC
This is not all-inclusive, but I think a list of some that most will want to know about.
Changed
- RichTextBox improvements
- WebBrowser control
- Printing API enhancements
- Native automation (COM interop)
- Language/Script support
- Networking and Sockets
- User consent dialog on webcam/clipboard/etc.
New
More Silverlight 4 Learning Resources
Learning resources suggestions:
- Silverlight learning videos for Silverlight 4 (3 new feature ones added)
- Silverlight 4 hands-on-labs – major updates including an 8-part business application lab
- Silverlight 4 books – check out what you can pre-order from the experts
Silverlight 4 Training Course
The Silverlight 4 Training Course includes a whitepaper that explains all of the new Silverlight 4 RC features, several hands-on-labs that explain the features, and a 8 unit course for building business applications with Silverlight 4. The business applications course includes 8 modules with extensive hands on labs as well as 25 accompanying videos that walk you through key aspects of building a business application with Silverlight. Key aspects in this course are working with numerous sandboxed and elevated out of browser features, the new RichTextBox control, implicit styling, webcam, drag and drop, multi touch, validation, authentication, MEF, WCF RIA Services, right mouse click and much more.
An awesome Powerpoint presentation on Windows Azure Platform
I just ran across a PowerPoint presentation by a colleague, David Chou, that is just plain awesome. Check out this deck on the Windows Azure platform.
Windows Azure PlatformView more presentations from lynnlangit.
Visualizing large code bases with VS2010
Chris Lovett posted a *great* 20 minutes video on how to use custom “Generate Dependency Graph” to manage larger code bases with the new visualization tools in VS2010.

Via Skinner’s Blog : Visualizing large code bases with VS2010
5 Steps Toward jQuery Mastery
Most of us get our first taste of jQuery by implementing a simple animation effect or using a plugin for a specific purpose. This is natural because, like JavaScript itself, jQuery lends itself to beginning with the basics and building from there.
As you branch out from the trivial and begin using jQuery for more complex solutions, it’s important that you stay vigilant for new ways to approach those more involved problems. What works well enough for a dozen lines of code may not work for hundreds, and the unforgiving cross-platform environment that comes along with developing for web browsers only magnifies any trouble you run into.
With that in mind, I want to share a few tips with you that I found valuable as my work with jQuery became more complex.
Use Firebug to experiment interactively …
Cache selector results …
Don’t use jQuery unless there’s a good reason to …
Learn advanced selectors, filters, and traversals …
Use CDN hosting when available …
Goto 5 Steps Toward jQuery Mastery | Encosia for details
