I liked this concept because it seems kind of sneaky. By that I mean, in the past I was only able to call a method from a base class via inheritance or creating an instance of the class itself. However, now by implementing a generic type parameter we can achieve the same thing. First we […]
Read More →Category: C# Blogs
Generic Interface with a type constraint in C#
In a previous blog I discussed how to use and implement an interface with generics. I decided shortly after that it would be a good idea, in my context, to loosely bind a type to the interface. In the previous blog, it was left 100% generic and that was fine for the example. However, there […]
Read More →How to convert Dictionary keys or values to a List
I once had a requirement that I needed to dynamically build a select statement, based on a users selection and then display the results in a DataGrid. The tricky part was that the column name in the select portion of the query was not always the name I needed to show as the column heading […]
Read More →Using Generics with Interfaces in C#
I wanted to create an interface; however one of the methods I wanted to implement in it had a class as a parameter. I thought about it and realized that be doing so I would be tightly binding my interface to a specific class. I didn’t think that was good practice because interfaces need to […]
Read More →Error – Class name is inaccessible due to its protection level
There is a pretty basic reason why this error happens. However, until you find the solution, it is a big deal. I was creating a simple base class like the below which I planned on extending in another class. public class TreeViewModel : INotifyPropertyChanged { TreeViewSelector() { } } However, when I tried to […]
Read More →Hey, the 90’s called and they want their website back
I got trolled once because of the way my website looked. I must admit, it did age a bit, but at the time I built it, using ADO.NET, ASP.NET Webforms (ASPX) and Master Pages, it was a pretty cool and sophisticated website for it’s time. Here is a tribute to my old C# blog look […]
Read More →Adding a context menu to a treeview Part 2
In my previous post I showed you how I added a context menu to a treeview. I had a new requirement that wanted a treeview property to contain a flag that could be turned on or off and that the value be displayed in the context menu. First I added the menuItem to the XAML. […]
Read More →Adding images to a Tree View in WPF using C#
Like I’ve said before, once you find what your looking for, it is easy to find examples about how to use and implement it. I had this again while trying to add images to a treeview. The term I was looking for, while trying to find a solution was ValueConverter. In this solution I will […]
Read More →Treeview with checkbox in WPF
On one of my projects I had to provide treeview selection functionality. I searched the internet and pulled everything I could into a this single resource. I wasn’t able to find 1 post that provided all the details and source code to do what I needed. Now there is one and if you find it, […]
Read More →Projects and Solutions in .Net (.csproj and .sln)
Holistic approach or high level approach are common phrases you will hear when beginning the design of a new system or the start of a new project that will modify or enhance an existing program. Therefore, when you begin a new project, start from the solution context. This means, know what the program does end-to-end […]
Read More →