Tutorials - C#, WPF, ASP.NET MVC, WCF, Entity Framework, AngularJS and MVVM Frameworks - MVVM Light - DotNetPattern.com

.NET Threading Interview Questions Series - Part 1

Q 1.  What is the difference between Process and Thread? A process is started when you start an Application. A process is a collection of resources like virtual address space, code, security contexts etc. A process can start multiple threads. Every process is start with a single thread called primary thread. You can create n number of threads in a process. Threads share...

Continue Reading

.NET Threading Interview Questions Series - Part 2

Q 21. What is the class hierarchy of wait handles? Q 22. What is ManualResetEvent and how it is different between AutoResetEvent? ManualResetEvent is also a synchronization mechanism similar to AutoResetEvent which works on bool variable. If the bool variable is false, it blocks the thread. If true, it unblocks the threads. ManualResetEvent provides the sa...

Continue Reading

WPF Architecture

WPF is a successor of Windows Forms. Earlier Windows Forms uses the Windows Graphics Device Interface (GDI+) for rendering any graphics, and drawing text. WPF is a new framework for developing rich Windows smart client applications that uses the DirectX technology behind the scene. WPF is resolution-independent because WPF uses vector graphics for drawing the controls on the sc...

Continue Reading

WPF BackgroundWorker

To build more responsive WPF UI, we have to use multiple threads that can work in the background and update the UI when the work completed. But background threads can't access the objects created in the STA. Then how can we update the UI when the background threads completed their work?  WPF applications are based on Single Threaded Apartment Model (STA). Ob...

Continue Reading

WPF ComboBox - Tooltip for each item

Many readers ask me a question regarding how we can add a tooltip for each item of ComboBox in WPF. Here I am presenting a very simple solution. In the below example, I am creating a simple combobox. ComboBox DataTemplate defines a ListBoxItem for each item in combobox. ListBoxItem has both Content and Tooltip property.  As we cannot use String.Format in Tooltip bi...

Continue Reading

WPF DataGrid - Auto Generate Columns

AutoGenerateColumns property automatically generate columns for display in UI from the bounded data source. It takes every public property in bounded data source to generate columns. For example, if you bind to below Employee class to DataGrid: public class Employee { protected int Property1 { get; set; } private int Property2 { get; set; } static int Propert...

Continue Reading

WPF DataGrid - Common Tasks

Table of Contents Change WPF DataGrid Selected Row Background Color WPF DataGrid Select All Checkbox Change Alternate Row Background Color Change the order (Reorder) of Auto Generated Columns Set Auto Generated Column ReadOnly Change WPF DataGrid Selected Row Background Color To change the background color of selected row of WPF DataGrid, you have two ...

Continue Reading

WPF DataGrid - Custom Columns

In the last tutorial AutoGenerateColumns, I have shown how DataGrid automatically shows different columns based on the data types of data. But by using the Columns property, you can change how columns are generated and of which control. By default, WPF provides 5 different types of custom columns shown below: Column Type Display Da...

Continue Reading

WPF DataGrid - Filtering

WPF DataGrid provides a way to filter its bounded list. In the filter method, you can choose only those items from the list that you want to show in WPF DataGrid. Rest items will be hidden. DataGrid uses ListCollectionView class for filtering list of items. ListCollectionView ListCollectionView is a special class which is used for grouping, sorting, and filter it&#...

Continue Reading

WPF DataGrid - Grouping

WPF DataGrid is also used for showing group of items DataGrid use ListCollectionView class for grouping the associated list. DataGrid GroupStyle.ContainerStyle provides a way to display Group Item detail and its associated items. ListCollectionView Class ListCollectionView constructor takes an IList collection and has a GroupDescriptions list property. In the Gr...

Continue Reading

Join our newsletter and get an occasional email with a technology and DotNetPattern.com news update.