```
class Sample
{
public StringDictionary StringMapping
{
get
{
return _stringMapping;
}
set
{
if (_stringMapping == value)
return;
_stringMapping = value;
OnPropertyChanged();
}
}
}
[TypeConverter(typeof(StringDictionaryConverter))]
[Serializable]
public class StringDictionary : Dictionary<string, string>
{
public StringDictionary()
{
}
protected StringDictionary(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
public class StringDictionaryConverter : SimpleDictionaryConverter<string, string, StringDictionary>
{
// convert dict to "key1=value1 key2=value2 ..." and vice versa
}
```
A text box will let me edit the values, while the property grid only shows "somenamespace.StringDictionary"
Comments: ** Comment from web user: BoucherS **
Hi,
The ToString method will display the content of properties. Here's an example :
```
<Grid>
<xctk:PropertyGrid x:Name="_propertyGrid" />
</Grid>
public partial class MainWindow : Window
{
public MainWindow()
{
Xceed.Wpf.Toolkit.Licenser.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXX";
InitializeComponent();
_propertyGrid.SelectedObject = new MyObject()
{
ID = 12,
MyPerson = new Person() { FirstName = "Tom", LastName = "Jones" }
};
}
}
public class MyObject
{
public int ID
{
get;
set;
}
[ExpandableObject()]
public Person MyPerson
{
get;
set;
}
}
public class Person
{
public string FirstName
{
get;
set;
}
public string LastName
{
get;
set;
}
public override string ToString()
{
return this.FirstName + " " + this.LastName;
}
}
```