WPF Tips and Tricks 001: TargetNullValue and FallBackValue

In this series of WPF Tips and Tricks we will cover smaller but useful WPF features which would help in making our applications better. n this first part of WPF Tricks,we will examine two often ignored and less frequently properties of Binding class - TargetNullValue and FallBackValue. TargetNullValue Consider the following View and ViewModel. View … Continue reading WPF Tips and Tricks 001: TargetNullValue and FallBackValue

Json To Xml : Wrapping the Array Elements

In this post, we will look into a scenario when you need to convert a Json to XML, but at the same time need to add a wrapping Property for each array. For example, consider the following Json { reportId : 23232, submittedBy : 'Anu Viswan', projects:[ { id:1001, name:'Project 1', }, { id:1002, name:'Project … Continue reading Json To Xml : Wrapping the Array Elements

Single View for Multiple ViewModels in Caliburn Micro

One of the recent questions I saw in Stackoverflow involved a scenario wherein, the developer had to reuse the same View for different ViewModels. In his case, the ViewModels where subtypes of same BaseViewModel and hence it made sense to reuse the View. For example, Consider the following public class TempatureViewModel:VariableViewModel{} public class PressureViewModel:VariableViewModel{} public class HumidityViewModel:VariableViewModel{} … Continue reading Single View for Multiple ViewModels in Caliburn Micro

Rosyln API Recipies Part 001

This blog post focuses on featuring couple of reusuable methods which one could find useful when working on Code Analyzer/CodeFix or Source Generators. HasAttribute Quite often one needs to check if the member declaration like Class, Property, Enum declaration has a particular attribute. The following method helps in detecting the same. public static bool HasAttribute<TAttribute>(this … Continue reading Rosyln API Recipies Part 001