Server thread culture

We may create a web application for users in specific region and all the formatting like displaying currency, dates in UI and client side code are done specifically for that culture (say X). These formatting may have different meanings in another culture (say Y).

When a user living in a demographic using culture Y loads the web application, browser sends the request with Accept-Language header in that culture (if the system’s or browser’s default culture is set to culture Y).

If web application is not configured correctly, server will automatically switch the thread culture based on Accept-Language in Request Header, things might go wrong when server side code executes this request with supplied data in a thread with culture set to Y (remember the data is formatted on client side for culture X and sent to server).

Since the web application is targeted for specific demographic, we should explicitly tell the server not to switch the thread culture based on Request Header and configure the application to always use culture X.

For ASP application this configuration can be specified in web.config

Following configuration tells server to automatically switch the thread culture based on Accept-Language in Request Header

Following configuration tells server to always execute the thread culture in en-US culture

Navigation using MVVM Light

I have been using MVVM Light for my windows phone app. If you haven’t heard about it, I would suggest you to read about it at mvvmlight and documents. It is a great toolkit and the first Nuget package I always add to my windows phone projects.

For starters, you can also go through following articles,

Recently when I was implementing navigation in my app,  I used Messenger as explained in Part 2 and Part 3.

Later while debugging the code, I realized all the viewmodels that registered  for GoToPageMessage received the message, but I was expecting only the viewmodel that is associated with the view which triggered the page navigation to receive the navigation message.

Then I went back to Galasoft to read more about Messenger and realized I should not be using Messenger for navigation for my case. And found a really good article about how to navigate using mvvm light

Also Laurent is going to do a pluralsight course on mvvm light which is exciting!

Things I would like to share