Skip to content
meziantou edited this page Jun 23, 2015 · 3 revisions
  • Add the reference to SoftFluent.Windows to your project
  • Register the XML namespace:
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:sf="clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows">
</Window>
  • Add the PropertyGrid to the window:
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sf="clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows"
        xmlns:local="clr-namespace:WpfApplication1"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.Resources>
            <local:Customer x:Key="SampleCustomer" />
        </Grid.Resources>

        <sf:PropertyGrid SelectedObject="{StaticResource SampleCustomer}" />
    </Grid>
</Window>
public class Customer
{
    public Guid Id { get; set; }

    [Category("Identity")]
    public string FirstName { get; set; }

    [Category("Identity")]
    public string LastName { get; set; }

    [Category("Identity")]
    public DateTime DateOfBirth { get; set; }
}

Result

Clone this wiki locally