The blog is close down

We will no longer keep this blog. For information about WPF, you can find more in Kevin Moore’s blog:  Thanks, ATC Avalon Team  


A Fancy StatusBar

Download and try it!  When moving Mouse over an item, the item jumps up until Mouse leaves. The key steps to achieve it are as follows.  1.      Subclass StatusBarItem and add new property ImagePath. Therefore, we can pass image to StatusBarItem easily.   2.      Subclass StatusBar and override MouseLeave and MouseMove event. In MouseMove event handler,…


How to Create a Custom View

One of the most powerful features of ListView is supporting custom views. If built-in views do not apply your scenarios, you can easily write your own. ListView will handle your views the same way with built-in views. Creating a custom view is pretty simple. ListView control has done quiet a bit of work to make the…


How to display data from database?

It is common for ListView to display data from database. In this blog, I will briefly introduce how to do this. To achieve this, we need to resolve two problems: Binding data table to ListView; Binding fields of data table to GridViewColumns. Binding data table to ListView How to bind data of a DataTable to…


Fixed-Width Column in ListView: A Column that cannot be resized

A fixed-width column is a column that cannot be resized by mouse dragging or double-clicks. You can find instances in outlook. Currently two methods can be used to achieve the effect. One is to restyle GridViewColumnHeader to remove the gripper inside its Template. The other is to subclass GridViewColumn to restrict columns’ width to a…


Other solutions to implement Alternate Background

We have found three solutions to achieve alternative background scenarios so far. The first one is provided in the previous post. Now we will describe another two.   The second solution:  Derive from ListView, override PrepareContainerForItemOverride method and return the container with the correct background. And in your xaml file, replace ListView with SubListView. When…


Alternate Background for ListViewItems

This sample shows how to create a ListView control that uses a GridView to display a list of dates that are defined as DateTime objects. Items in this example have alternate background.   Key Step 1. Restyle ListViewItem, and set its Background by converter in the new style.       <l:BackgroundConvertor x:Key=“myConverter“/>     <Style x:Key=“myItemStyle“…


ListView with grouping (In GridView mode)

ListView inherits GroupStyle from ItemsControl, so we can easily achieve grouping for GridView. The only thing we should provide is a GroupStyle. Besides, in order to collapse and expande a group, an Expander is added in the GroupStyle. The number on the group header indicates the count of items in that group. Declaimer: This posting is provided…