Invisible properties

Jan 5, 2011 at 8:56 PM

I have some properties for which I do not want to have any visible editor or category tab.

How can this be accomplished?




Jan 5, 2011 at 9:02 PM

Did you try using the attribute [Browsable(false)]?

Jan 5, 2011 at 9:17 PM

no, I ended up doing this:

                PropertyDialog dlg = new PropertyDialog { DataContext = DataContext};
                dlg.PropertyControl.ShowReadOnlyProperties = false;
                dlg.PropertyControl.ShowTabs = false;
                dlg.PropertyControl.ShowCategoriesAs = ShowCategoriesAs.Expander;

I'll try the Browsable attr.

Maybe there's some better way to skin the cat?



Jan 5, 2011 at 9:19 PM

that works too and it makes more sense.





Jan 6, 2011 at 4:37 AM

It should also be possible to make a property visible/invisible dynamically. If your property is "Address" you can add a bool property "IsAddressVisible" to control the visibility of the Address property. Remember to raise INotifyPropertyChanged to make it work. See the examples.