Making NotifyPropertyChanged refactorable.

Common problem when using INotifyPropertyChanged interface is that the PropertyChangedEventHandler event accept a string property name as a parameter. That cause a possible problem when we want to refactor the property and forget to update the provided property’s name. There is a plenty of blog threads in the web that tries to solve this problem. The very common solution benefi…

By Mirek on (tags: INotifyPropertyChanged, categories: code)

Bringing “Create Unit Tests…” option back

Since I stared using Visual Studio 2012 I noticed a lack of quite helpful and commonly used (I guess) feature which is Create Unit Test context menu option. It turned out that this is still there… …but hidden from the user. Going through the jungle of VS customization options you can find it and make it visible in context menu. But there is an easier and more elegant way descri…

By Mirek on (tags: Unit test, Visual Studio 2012, categories: tools)

Task-based Asynchronous Pattern

Task-based Asynchronous Pattern with async and await keywords introduced in .net framework 4.5 starting point. First recommendation is downloading and reading 96 pages document about Task-based Asynchronous Pattern from Microsoft Download Center. Next go through the msdn lab: here and article  here. Have a nice reading…

By Mirek on (tags: async, TAP, categories: architecture)

MV* javascript libraries

You probably heard about knockout.js. Well, there are others like it.   Here are a few that I plan to look at in the nearest future: Angular – developed and maintained by google. Read some good reviews about it. Durandal – not sure how I stumbled upon that, but they do have a bold punch line – “Single page apps done right” – and just for that, it’s worth looking at Backbon…

By on (tags: javascript, categories: tools, web)

jQuery alternative – zepto.js

If for some reason you think that jQuery is ‘too much’ to use in your web app, then here’s an interesting alternative – zepto.js

Taken from their website:

I guess it’s worth giving a shot, especially if you need to create something with a small footprint.

Cheers

By on (tags: javascript, zepto, categories: tools, web)

Sortable and expandable enums

Have you ever faced the problem that extending enum type by new values may cause unpredicted behavior of the application? I recently have. As the solution for this problem I figure out how to design enum values so they can be easily sortable and easily expandable in future, causing no side effect. We have a simple enum type ConstructionSteps we use   The framework will aut…

By Mirek on (tags: enums, categories: code)

jQuery deferred

The Deferred object has been in jQuery since version 1.5 but I haven’t had the chance to get to know it until recently – turns out that it’s rather handy to have in your toolset. For a brief introduction, take a look at this link. Cheers…

By on (tags: jQuery, categories: web)

Getting MIME type for file

All I can say is THANK YOU. http://blogs.msdn.com/b/webdev/archive/2013/02/14/getting-a-mime-type-from-a-file-extension-in-asp-net-4-5.aspx and the msdn docs: http://msdn.microsoft.com/en-us/library/system.web.mimemapping.getmimemapping%28v=VS.110%29.aspx…

By on (tags: None, categories: web)

WPF switch panel

The panel which switch its content depending on the value of boolean flag is the topic of this post. The WPF application I’ve recently coded was a MvvM application and had a number of editable fields. The fields were editable only in specific circumstances and when the proper flag IsEditionMode has been set to true on the ViewModel. For trivial cases I could use TextBox with Is…

By Mirek on (tags: custom controls, SwithPanel, WPF, categories: code)

MVC parameter binding

Here’s a piece of information that will hopefully save you the time I spent on trying to figure it out… asp.net mvc parameter binding is localizable ONLY in the case of POST form action. So if you’re trying to bind a date time, and have globalization turned on in web.config, then you need to parse the parameter yourself. The parameter needs to be of type string, because making …

By on (tags: mvc, categories: code)