The new String Interpolation and Ternary Operator

A quick tip for the new C# string interpolation. The new string interpolation has made things more simpler and readable. One might be tempted to include ternary operators within string interpolation. However if you attempt something like following, the compiler would throw an error The fix is as simple as it can get. Just include … Continue reading The new String Interpolation and Ternary Operator

Deconstruct and Extension Methods

In an earlier post, we explored the Deconstruct feature for Non-Tuples. It was a pretty useful feature that came along in the 7.x series . If one does have access to source, adding deconstruct is quite easy. But what about classes we do not have (source code) access to ? For example, the .Net framework … Continue reading Deconstruct and Extension Methods

Caliburn.Micro #007 : Bootstrapper with Unity

Unity is one of the most commonly used IOC containers used by developers, and it would be unfair if I don't include it as a part of the Caliburn.Micro WPF Tutorials (Creating Bootstrappers).  This particular post is dedicated to building bootstrapper for Caliburn.Micro application using Unity as the IoC Container. The key for creating Bootstrappers … Continue reading Caliburn.Micro #007 : Bootstrapper with Unity

Lock for Async Methods

Despite the intended nature, we seldom might come across situation where we would want to place a lock around an async statement and make it behave differently, especially when accessed from different threads. Let's try to mock the scenario first to demonstrate the issue. The lock-async Problem Consider the following code snippet. The output of … Continue reading Lock for Async Methods

Invoke UIElement’s Focus() Method From ViewModel

One of the things WPF developers often notice is inability to SetFocus on a particular control from the ViewModel. This problem can be however easily resolved using an attached property. Let's examine the code. We will begin by writing an attached property, for the purpose of example, named as IsFocused. The sole objective of the … Continue reading Invoke UIElement’s Focus() Method From ViewModel

SharedSizeGroup: Managing Column Size across Grids

SharedSizeGroup is an underused WPF attribute, but one that can make life lot more easier when design WPF forms with multiple Grids that need to share a column size. Consider the screenshot below. The three pairs of Label and Textbox are in separate grids (with column width set to auto), resulting in an unorganized layout. … Continue reading SharedSizeGroup: Managing Column Size across Grids

Leaders and Eye Specialist

How do I define leadership or how would like myself to be seen as a leader in the future. These are some of the questions I often come across. To be honest, it is quite hard to answer it precisely, after all, each 'act' of leadership depends on various factors including what the circumstances/situation demands. … Continue reading Leaders and Eye Specialist