Hi Shashank,
Thank you for your comment :)
I've took the liberty to write a simple style MVVM View-First using Extended WPF Toolkit PropertyGrid:
http://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid[
^]
The MainWindow.cs:
<Window xmlns:my="clr-namespace:WpfPropertyGrid" x:Class="WpfPropertyGrid.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<my:View />
</Grid>
</Window>
The View.xaml:
<UserControl x:Class="WpfPropertyGrid.View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xceedPg="clr-namespace:Xceed.Wpf.Toolkit.PropertyGrid;assembly=Xceed.Wpf.Toolkit"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<xceedPg:PropertyGrid SelectedObject="{Binding}"/>
</Grid>
</UserControl>
View.cs:
public partial class View : UserControl
{
public View()
{
InitializeComponent();
this.DataContext = new ViewModel();
}
}
ViewModel.cs:
public class ViewModel
{
public ViewModel()
{
FirstName = "Shai";
LastName = "Vashdi";
}
[Category("Information")]
[DisplayName("First Name")]
[Description("This property uses a TextBox as the default editor.")]
public string FirstName { get; set; }
[Category("Information")]
[DisplayName("Last Name")]
[Description("This property uses a TextBox as the default editor.")]
public string LastName { get; set; }
}
I Hope It helps :)