Author Archives: Dave Corun

HttpContext.Current.Session – Unit Testing

Here is a quick clever trick for failing over the connection string, in the case that it doesn’t already exist on the HttpContext.Current.Session object. As you may know, Unit Testing frameworks don’t always mock out the HttpContext class properly, if … Continue reading

Posted in Development | Tagged , | Leave a comment

My First Windows Phone 7 App

This will be a good way for me to document what I’m learning, while building my first “real” Windows Phone 7 app. Background My intent is to build a Personal Bartender app. It will look something like this: What I’ve … Continue reading

Posted in Development | Tagged , | 2 Comments

Cannot Freakin’ Wait for Windows Phone 7!

I already have some great ideas! // Dave

Posted in Development | Tagged | Leave a comment

Incredibly Useful Developer Tools

These are some tools I have a hard time living without. Syntevo SmartSVN JetBrains Resharper SourceGear DiffMerge Silverlight Spy Notepad++ Fiddler2 HttpWatch RedGate ANTS Profiler WinRar // Dave

Posted in Development | Tagged , , | Leave a comment

Getting Useful Error Messages out of Silverlight

Step 1: Change the default behavior of WebRequest errors goes to the ClientHttp stack instead of the default browser handling.   // Tell Silverlight that the ClientHttp stack should be used. // This let’s us get more detailed exceptions from … Continue reading

Posted in Development | Tagged | 1 Comment

Silverlight–Quickly Enable / Disable All Buttons

Here is some clever code to Enable or Disable all buttons on a Silverlight page.     /// <summary> /// Bulk disable / enable all of the buttons on the UI /// </summary> /// <param name="isEnabled"></param> public void EnableDisableButtons(bool isEnabled) … Continue reading

Posted in Development | Tagged | 1 Comment

Silverlight XAML Designer– Making files open faster in Visual Studio 2010

This little tip is probably all over the place, but just in case: When you open a xaml file, the Visual Studio 2010 designer is also loaded, which can take significant time. If all you’re doing is messing with the … Continue reading

Posted in Development | Tagged | 3 Comments

Passing Values between Pages in a Silverlight 4 Navigation Application

Often you’ll want to pass selected values from one page in a Silverlight 4 application to another. Query Strings are a valid approach, but you might want to pass more than simple strings or IDs in the URL. This quick … Continue reading

Posted in Development | Tagged | 11 Comments

Silverlight Resources

Defining Resources In Silverlight you can define resources, which will be available to the rest of the application.  You can define these resources at the top of your user controls, in your pages, App.xaml, or in separate ResourceDictionaries. App.xaml is … Continue reading

Posted in Development | Tagged | Leave a comment

Displaying the Assembly Version # from a Silverlight 4 App

Assembly assembly = Assembly.GetExecutingAssembly(); String version = assembly.FullName.Split(‘,’)[1]; String fullversion = version.Split(‘=’)[1]; int build = int.Parse(fullversion.Split(‘.’)[2]); int revision = int.Parse(fullversion.Split(‘.’)[3]); DateTime buildDate = new DateTime(2000, 1, 1).AddDays(build).AddSeconds(revision * 2); String fulldate = buildDate.ToLocalTime().ToString(CultureInfo.InvariantCulture); txtAssemblyVersion.Text = fullversion + Environment.NewLine + buildDate.ToShortDateString() … Continue reading

Posted in Development | Tagged | 1 Comment