Jim McCurdy's Tech Blog

Insights into C#/XAML Development; Windows 8 (WinRT), WPF, Windows Phone, Xamarin, Silverlight

A TextBox that selects its text on focus for Silverlight

A minor annoyance of mine is that there is no way to wire up a standard Silverlight TextBox to select its text when it receives the keyboard focus; either via a mouse click or a tab key. And since users are accustomed to web apps, browsers, and desktop applications that offer the the convenience of selecting textbox text  upon focus, I wanted that behavior in my Silverlight applications.&nbs... [More]

Settings for Silverlight using IsolatedStorageSettings

Here is a simple static class, Settings, that offers methods to Read and Write application settings and preferences from Silverlight applications.  These settings are similar to the ones that Windows apps would store in the registry or in an INI file, but in this case, are written to Silverlight’s isolated storage. This class wraps Silverlight’s IsolatedStorageSettings class, so r... [More]

The simplest way to detect DoubleClick in Silverlight

Here is a simple static class, MouseButtonHelper, that offers a single method, IsDoubleClick,  to determine if a standard MouseLeftButtonDown or MouseLeftButtonUp event is a double click.  In the past I have used timers, and Triggers and Behaviors to accomplish the same thing, but this approach is less code, less XAML, and uses a lot less resources. Usage is as follows: In XAML or in co... [More]