5 minutes Guide of WPF ListView ItemTemplate

ListView control in WPF is used for display a list of items. Every list view item has its own UI for display its own data. But how every listview item is rendered, it's depend on the ItemTemplate property of ListView. ItemTemplate property is used for get and set the DataTemplate of every list view item. DataTemplate defines how each item appears. You defines a single...

Continue Reading

Quick Tips to Filter ListView in WPF

WPF ListView does not support Filtering by default. ListView does not have their own methods to filter the bounded list. But WPF has a very special class CollectionViewSource which supports Filtering very effectively and in very easy way. What is CollectionViewSource class? CollectionViewSource is a class which we can use in WPF for filtering and sorting a bounded ...

Continue Reading

How to Apply WPF ListView ItemContainerStyle

ListView ItemContainerStyle specifies a style that is used by every generated ListViewItem for styling it. You can create a Style inline or in the Resources section and set the ItemContainerStyle property of ListView. You can set ItemContainerStyle as StaticResource or DynamicResource. When to Use? By default you cannot modify style of ListViewItem in WPF ListView....

Continue Reading

How to Hide WPF ListView Columns in MVVM?

ListView control is a very popular control among WPF developers. Developers use ListView control for showing the data in tabular format. Sometimes, we need to hide WPF ListView columns, but wpf does not provide any default implementation for hide WPF ListView columns. I have developed a WPF Behavior to hide WPF ListView columns through Attach property. An attached&...

Continue Reading

Start with MVVM Light Toolkit

MVVM Light toolkit is a lightweight toolkit for MVVM.  This toolkit provides very basic classes for developing your application in MVVM architecture. You can download the latest MVVM Light Toolkit from here. MVVM Light Toolkit comes with 2 main DLLs. GalaSoft.MvvmLight.dll GalaSoft.MvvmLight.Extras.dll Main classes in GalaSoft.MvvmLight.dll are:...

Continue Reading

MVVM Light Messenger

MVVM Light Messenger is a class that allows exchange messages between objects. Messenger class is mainly used for sending messages between viewmodels. Messenger class decreases coupling between viewmodels. Every viewmodel can communicate with another viewmodel without any association between them. Messenger is an implementation of Mediator pattern in MVVM Light tool...

Continue Reading

MVVM Light Toolkit Example

In my previous blog, I have showed you some main classes in MVVM Light Tookit. In this blog, I will show a simple MVVM Light Toolkit example. In this example, we will create a sample application for loading and saving the employees details using MVVM Light Toolkit. We will do below tasks one by one: Add a reference of MVVM Light Toolkit into...

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

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