Skip to main content

Posts

Propagating Property Change for Static Properties

While working on any XAML based app, first thing which comes into mind is Binding . There are lot many articles on what is Binding and how it works. Don’t worry, I am not going to repeat all that stuff again. But definitely, I would like to touch upon few things which are base of my today’s write-up. To make any property bindable or let’s say to propagate property change, we usually follow one of the below two options: Implement INotifyPropertyChanged interface or Create an event with name PropertyNameChanged Point to notice here is, both the above options will work only on instance properties. Now what if my property is Static??? INotifyPropertyChanged is not going to work for static properties. None of the above options will make x:Static extension work. What to do now ? No worries, all these hazards can easily be overcome when you will jump to .Net 4.5. Approach 1: Property specific static event for each and every static property Let’s have a look a...

Identify WPF version

If you want to figure out the current version of WPF installed on your machine, then one has to navigate to registry for below path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Presentation Foundation Version value on above path will give your the required information.

.Net Framework 4.5.2 is available

Microsoft recently released .Net Fx 4.5.2 which is in-place update for .Net Framework 4, .Net Framework 4.5 and .Net Framework 4.5.1 and is ready for download on below links: .Net Framework 4.5.2 Offline Installer .Net Framework 4.5.2 Web Installer This includes updates for ASP.Net, Windows Event Tracing (ETW), better profiling as well as for DPI settings. Enjoy...

EF warning while using Database first approach

Error 6002: The table/view 'AdventureWorks.dbo.BuildVersion' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view. Explanation: The above warning is generated when you use Database first approach for Entity Framework model creation. Such warning appears due to entity key. Every Entity needs to have an entity key and when EF creates an entities, what it does is, it tries to find an primary key from the database and creates an entity key from that.  But it may be the case that few of the database objects doesn't have primary key defined. In that case, EF tries to infer a key based on your view or table's columns. So, here it becomes necessary to have at lease a non-null column in your database object.  It's just a warning, so nothing harmful here. But still if you need a solution to get rid of this warning, then it is posted by Hilmi Aric.

Visual Studio Extension for Installer Templates

Finally Installer Projects templates are back with Visual Studio. Hope most of you are aware that few years back, Microsoft removed the templates for installer projects from Visual Studio and we all were obliged to use InstallShield.  Till Visual Studio 2010, these templates were shipped along with VS but post releases were not having these templates. But user voice and vocal feedbacks made this possible and now these templates are again part of Visual Studio 2013 and will continue to be the part in all the Visual studio’s future versions. This Extension can be downloaded either from Visual StudioGallery or by using ‘Extensions and Updates’ dialog’s online section with a search string as ‘Visual Studio Installer Projects Extension’. Important point to mention here is, Visual Studio will still provide the in-box solution for InstallShield limited edition. As of now, this update is part of preview release version;)

Deadlock and Livelock

Deadlock:  Deadlock is a situation when two processes, each having a lock on one resource and attempt to acquire a lock on the other's resource. In this case, each process would have to wait indefinitely until one of them releases the lock on the holding resource. Livelock:  Livelock is a situation, where in a request for an exclusive lock  is repeatedly denied because of series of overlapping shared  locks keeps interfering. A  livelock also occurs when read transactions monopolize a resource(file/page/memory location), forcing a write transaction to wait indefinitely.

Controlling Degree of Concurrent Execution in Parallel Loops

Having multi-core machine, one can get the benefit of Parallelism for long-running and blocking tasks. I hope most of you might have used Parallel. For, Parallel. Foreach and TPL several times. Generally parallelism is used to get the benefits of all the available cores on the machine that commonly leads to the shortest execution time for any task. Did you ever thought about what can be the possible demerits of using all the available cores for just a single application? Is it really required to use all the available cores of your machine for a single application? Can't we use only a few of the cores? Is there any way to restrict these parallel loops in terms of cores? The answer of all the preceding questions is YES . But why should we bother about how many cores are participating in execution? Well, there can be several reasons behind this.  The foremost reason  that I feel is, when a single time consuming application/task is running on all the available cores utili...