A recent question I came across recently was "How could one stop the caret in a WPF Textbox from blinking ?". My first instinct drove me in the direction of HideCaret method, but quickly realized WPF applications doesn't allow you to get the Handle for individual controls. It only provides handles for Windows. This was … Continue reading Non-Blinking Caret in WPF Textbox
Author: Anu Viswan
Type Argument Inference during Type Initialization
One of the least discussed topics about compiler and Generic Methods is its ability to infer the Type Arguments. For example, consider the following code. A typical invocation of the code might look like following. However, in some scenarios as above, the compiler is smart enough to allow you to skip the type argument from … Continue reading Type Argument Inference during Type Initialization
SOLID : Liskov Substitution Principle (Part 1)
The "L" in SOLID stands for Liskov Substitution Principle, named after Barbara Liskov, who initially introduced in 1987 keynote address. LSP provides guidelines for creating inheritence heirachy where a client can use any class or subclass without breaking the expected behavior. We will begin by looking at the official definition first. If S is a … Continue reading SOLID : Liskov Substitution Principle (Part 1)
Evil Code #009 : nameof Operator
The nameof() operator has been so commonly used by the developers that one could not be called guilty if he assumes it was there since C# was born. Despite that, there are days it might still surprise you. What would be your reply if I asked you to predict the output of the following. No … Continue reading Evil Code #009 : nameof Operator
GOF: Composite Pattern
Composite Pattern, in a way, literally takes of from where Decorator Pattern ends. One might be inclined to think of it as a specialized case of Decorator Pattern which composes one or more instances of similiar objects and manipulate them uniformly. This allows the client to work on a single entity or composition of entity … Continue reading GOF: Composite Pattern
3 Rules for TDD
I couldn't help but share this. There couldn't be a better way to summarize the unwritten rules of TDD, than the one wrote by Uncle Bob in his famous book 'Agile Principles, Patterns and Practices in C#''. Don't write any production code until you have written a failing unit test. Don't write more of a … Continue reading 3 Rules for TDD
Revisting Anonymous Type
While classes and structs are extremely powerful, there are times when you want to escape the cermonies they require even for simplest of design. This is where anonymous types comes handy and has been so frequent used by the developers. So what are Anonymous types really ? Let's consider an example first. Anonymous Types are … Continue reading Revisting Anonymous Type
Zoom Rectangle with OxyPlot
Let's stick to OxyPlot for some more time. This time, we would attempt to change the color of Zoom Rectangle. For those who are new to Oxyplot, the control allows you to zoom in a particular location by permitting the user to draw rectangles in the graph. This particular rectangle is known as Zoom Rectangle. … Continue reading Zoom Rectangle with OxyPlot
Caliburn.Micro Template Pack now supports VS 2019
So glad to announce that Caliburn.Micro Template Pack now supports Visual Studio 2019. Caliburn.Micro Template Pack for WPF contains a comprehensive collection of Project Templates and Code Snippets for developing WPF application using Caliburn.Micro. It also includes Bootstrap templates for SimpleContainer, MEF and Unity. You can download the template from Visual Studio Marketplace You can … Continue reading Caliburn.Micro Template Pack now supports VS 2019
Oxyplot : Using Datagrid for tooltip
Oxyplot uses Tracker Controls for displaying tooltip. You could extend the display by Customizing the Default Tracker control. In this article, we will look deeper into that Tracker Control and aim to display a Grid in the Tracker Control. For sake of example, let us assume a Fruit Seller, who wants to plot his sales … Continue reading Oxyplot : Using Datagrid for tooltip