Welcome to WindowsClient.net | Sign in | Join

Cristian Ricciolo Civera

Windows Presentation Foundation, C++ CLI, LINQ and experiments

Sponsors





  • advertise here

March 2008 - Posts

A complete WPF TreeListView control

Yes, I know, there already is a TreeListView control in the SDK, but it's simple and it isn't complete, so I developed a my custom control working on .NET Fx 3.0/3.5. It supports template, binding, scrolling and themes (classic, aero, luna). It's quite simple to use:

<r:TreeListView ItemsSource="{Binding Source={StaticResource data},XPath=/opml/body/outline/outline}" ItemTemplate="{StaticResource dt}">
    <r:TreeListView.Columns>
        <GridViewColumn Header="Title" DisplayMemberBinding="{Binding XPath=@title}" Width="150" />
        <GridViewColumn Header="Childs" DisplayMemberBinding="{Binding XPath=@count}" Width="100" />
        <GridViewColumn Header="Url" DisplayMemberBinding="{Binding XPath=@xmlUrl}" Width="200" />
    </r:TreeListView.Columns>
</r:TreeListView>

And below a screenshot of the control in action:

The control inherits from TreeView and TreeViewItem classes and uses a custom converter to indent items. The most of work is into the xaml files, built copying markup from original TreeView and ListView styles.
I used this control into my project PaperBoy.

I hope you find useful :-). Download full source control.

WPF AdvancedListBox for Zune effect

I like WPF very much and I often prepare some controls for my applications. This time I want to show a simple control extension added to ListBox. Its name is AdvancedListBox that uses custom ListBoxItem and it exposes some properties to know if ListBox is loosing or capturing the selection.

Using style I have created a sample that simulates Zune navigation effect: a background animation from previous to next selection. Here the result:

WPF AdvancedListBox
WPF AdvancedListBox

And here the source.

Page view counter