Jonas Stawski

Everything .NET and More

Programmatically hiding the keyboard in Windows Phone 7 (WP7)

I was looking for a way to programmatically hide the keyboard in WP7 and was searching for some WP7 API method, but couldn’t find one. Then it dawn on me that the keyboard automatically hides when the TextBox control looses focus. So I decided ... [More]

My Windows Phone 7 App failed… Requirement 5.2.4.c

So I submitted my third app, Shapes, into the WP7 Marketplace and 48 hours later I get an email saying it failed. I read the details and it failed because of requirement 5.2.4.c: If the current page displays a context menu or a dialog, the p... [More]

Sample Code for Getting the User Location based on the IP Address

Yesterday I introduced a free service to get the location of the IP Address. If you haven’t read it, go on read that first (it’s very short, I promise). So here I am today, showing you my small .NET API to abstract the XML returned by the service. F... [More]

Get Location of the IP Address

I wanted to share with all of you a free service that provides you an approximation of your user’s IP Address. You can read about it here: If you are looking for a more sophisticated solution that is maintained more o... [More]

Generic CreateRange Extension

I was in need of a CreateRange method, similar to the Enumerable.Range(1, 10), that return an Enumerable of Dates. Doing a search I stumble along this blog post, which contains a generic CreateRange method. I then went ahead and converted the code to... [More]

ObservableDictionary Object

I was in need of an ObservableDictionary object for .NET 2.0 and there was no CLR object that met my requirements. All I needed was a Dictionary object that would notify me when a value was changed. I created a CodePlex project where you can download... [More]

Serializing Objects with Enums

Take into consideration the following entity: public class CompositeType { public bool BoolValue { get; set; } public string StringValue { get; set; } public EnumType VehicleType { get; set; } ... [More]


This is more of a "mental" note for me than anything else, but I would like to share it with everyone as well. The DateTime.ToString method has 2 overloads, one with no parameters and the other with a string parameter. I would like to talk about the ... [More]

Behavior of Default Constructors and Base Classes

A client of mine requires us to use ReSharper. I usually don't like to use any of those tools because if I get used to then and I go crazy when I do not have them, but I think I will give ReSharper a chance at my own dev machine. One of the cool feat... [More]

Container.DataItem. What exactly is this?

Recently I had to bind to an array of strings and I wasn't sure how to show the value of the current item. After a little bit of help from the DevTheo and a little bit of thinking I figured out the solution was very simple. All i had to do was bind i... [More]