WPF Controls - ListView, GridView, DataGrid, TabControl, Label, MVVM Frameworks - MVVM Light

Quick Tips to use WPF ListView ItemTemplateSelector

WPF ListView ItemTemplateSelector is used for choosing a DataTemplate for each ListViewItem at runtime. You can provide a custom logic to choose which DataTemplate to use in list view item. When to use? You have to show different UIs for each ListViewItem based on some condition. But using the ItemTemplate you can only set only one DataTemplate which is used by every List...

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

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

WPF ListView - Hide Column Headers by simple Style

WPF ListView is a very popular tool for showing list of items. Sometimes we need to hide the ListView column headers and only show the list of items. But ListView does not provide any default behavior or property for hiding the column headers. By applying a simple style you can hide the column headers of WPF ListView. <Grid> <ListView x:Name="List...

Continue Reading

WPF ListView ItemTemplate Tutorial

WPF provides various templates for customization of controls. WPF ListView ItemTemplate is in one of these. ItemTemplate of ListView is useful when we have to change the visual presentation of bound data objects. If your WPF ListView control is bound to collection of objects using ItemsSource proeprty and you have not set the ItemTemplate property, then it will call the...

Continue Reading

WPF Label Control - Guide and Examples

Label control is used for showing the text data in the WPF application. It also provides support for Access Keys. <Label /> Content Property Label is directly inherit from ContentControl class which provides the Content property to Label control. In the Content property, you can set the string or host any type of child control. <StackPanel M...

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 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 Tab Control - Introduction

WPF TabControl is used for grouping multiple items that share the same space. TabControl consists of multiple TabItem controls. One one TabItem is visible at one time. A TabItem has two areas. Header Content Header is an area for specifying the header of TabItem. All Tab Items headers are always visible. Content is an area for specifying the child...

Continue Reading

WPF TabControl - Binding

TabControl provides a ItemsSource property to bind list of items. ItemsSource takes any collection object which implements the IEnumerable interface. We bind TabControl with the List<T> or ObservableCollection<T> list classes. Below is the example TabControl binding with list of MyTabItem class. TabControl Binding Example Create a new MyTab...

Continue Reading

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