60 people following this project (follow)

Project Description
Library of custom controls for WPF: PropertyGrid, DataGrid, multi-select TreeView, ColorPicker and more.

NuGet package

The easiest way to use this library is to add a reference from the NuGet package manager.
Search for "PropertyTools.Wpf".
The build machine is updating the NuGet package at each build.

PropertyControl

This is a 'property grid' control with a TabControl/GroupBox layout.

propertycontrol.png

The XAML for this example is:
<Window x:Class="SimpleDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:pt="clr-namespace:PropertyTools.Wpf;assembly=PropertyTools.Wpf" 
        Title="PropertyControl" Height="400" Width="300">
    <Grid>
        <pt:PropertyControl Margin="8" SelectedObject="{Binding SelectedPerson}"/>
    </Grid>
</Window>

And the Person class:
    public class Person
    {
        [Category("Data")]
        [DisplayName("Given name")]
        public string FirstName { get; set; }

        [DisplayName("Family name")]
        public string LastName { get; set; }

        public int Age { get; set; }

        public double Height { get; set; }

        public Mass Weight { get; set; }

        public Genders Gender { get; set; }

        public Color HairColor { get; set; }

        [Description("Check the box if the person owns a bicycle.")]
        public bool OwnsBicycle { get; set; }
    }

See the PropertyControlDemo for all features.

ItemsGrid

Same look and feel as SimpleGrid, but this can only be bound to collections (not to arrays).
Binds directly to the properties of the items!
Will add more info later.

SimpleGrid

This control started as a very simple grid for use inside the PropertyControl. The intention was to make a grid control with a spreadsheet look and feel.
Note: this control is not doing virtualization and should be used for small collections only.

exceldemo.png
  • Binding to both Arrays and IEnumerable sources
  • Fit column width to available size
  • Autofill
  • Copy/paste
  • Zoom (Ctrl+mousewheel)
  • Insert/delete items
  • Auto-generate columns
  • Custom type datatemplates (can be used in any column)
  • Custom column datatemplates

TreeListBox

This is a ListBox that looks and feels like a TreeView. Supports all selection modes of the ListBox.
treelistbox.png
  • Multi-select
  • Drag-drop friendly
  • Styled like the Windows 7 Aero explorer tree

ColorPicker

colorpicker1.png

ColorPicker2

colorpicker2.png
colorpicker2b.png

<pt:ColorPicker2 SelectedColor="{Binding Color}"/>

Other controls

  • RadioButtonList (binds to enum)
  • EnumMenuItem (creates checkable menuitems from an enum)
  • EditableTextBlock (TextBlock that can be changed into a TextBox, useful for in-place editing in TreeViews)
  • FilePicker (TextBox with browse button)
  • DirectoryPicker (TextBox with browse button)
  • DockPanelSplitter
  • SpinControl
  • LinkBlock (Hyperlink on a textblock)
  • SliderEx (calls IEditableObject.BeginEdit/EndEdit when thumb dragging)
  • PopupBox (a restyled ComboBox where you can put anything in the Popup)
  • FormattingTextBox (a TextBox where you can bind the StringFormat)

Dialogs

  • Generic AboutDialog
    • Titles and version is taken from AssemblyInfo
    • Open System Info...
    • Copy report
  • Generic PropertyDialog (not finished)
  • Generic WizardDialog (not finished)

aboutdialog.png
About dialog - the information is taken from the AssemblyInfo.

OptionsDialog.png
A PropertyDialog bound to Settings.Default

Contributions
Please search for "todo:" in the source code to find places where you can contribute!
Create a patch and upload it on the Upload patch page.

Requirements
  • VS 2010 and Microsoft .net Framework 4.0

Links

PropertyGrids
DataGrids
ColorPickers

Last edited Mar 7 at 5:46 PM by objo, version 58