Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: PropertyGrid disable class name in title

$
0
0
I was wondering if it's possible to remove the class name from the default title of a property grid. For example, I have a PropertyGrid with the following properties:
<xctk:PropertyGrid BorderBrush="Transparent" BorderThickness="0" Background="LightGray" ShowSearchBox="False" ShowSummary="False" ShowSortOptions="False" ShowPreview="False" ShowAdvancedOptions="False" SelectedObject="{Binding ObjectInstance}"/>
The object bound to ObjectInstance is:
public class ExperimentViewModel : ViewModelBase
{
    //// other stuff...

    [Browsable(false)]
    public string Name
    {
        get
        {
             return "Experiment";
        }
    }

    public override string ToString()
    {
        return Name;
    }
}
This is the result on PropertyGrid:
Image

It looks like "ClassName Name". What can I do to not show the class name ExperimentViewModel and only show the "Name" property by itself. From a usability perspective, the user shouldn't have to see the actual class name behind the selected object.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>