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

Google Authentication for your Azure Function app

In this blog post, we will focus on Authenticating Azure Functions using Google Authentication. We will be using App Service to use Google as our Identity Provider. Let us begin by creating our sample Azure Function and deploy it to Azure. We will ensure that the Authentication Level is set to Anonymous for our sample … Continue reading Google Authentication for your Azure Function app

Debugging C# Source Generator

In this post, we will look into how to Debug Source Generator using Visual Studio 2019. The prerequisite is to ensure you have Visual Studio 2019 16.10 or above. Prerequisite Ensure you have Visual Studio 2019 16.10 or above.Ensure .Net Compiler Platform SDK is installed. To install .Net Compiler Platform SDK, launch the Visual Studio … Continue reading Debugging C# Source Generator

Source Generator : AutoToString

In this post, we will look into an application of Source Generator. Quite often, during debugging, you would wish if you had overridden the ToString() method of the class, so that you could understand the state of the instance. These are especially useful when you are dealing with a collection of the type. The ToString() would provide you a … Continue reading Source Generator : AutoToString

Embed external application inside WPF Application

A friend of mine wanted to embed a third party application within her WPF application. While at first I was slightly confused, a bit of googling made life easy. Center idea revolve around launching the third party application using the Process class and use the Win32 API methods to embed it within the client application. var process … Continue reading Embed external application inside WPF Application

.Net 6 : Jwt Authentication in Minimal Web Api

In the previous post, we delved into Jwt Authentication implementation in the .Net Core 5. In this post, we will create a Minimal Web API (introduced in .Net 6) and implement Jwt Authentication in it. Minimal Web API allows developers to build low ceremony web apis without the overhead of ceremonial code in traditional Asp.Net core MVC … Continue reading .Net 6 : Jwt Authentication in Minimal Web Api