Beispiel #1
0
        public EditorWindow(object action)
        {
            var configPropCollection = ConfigPropertyCollection.FromObject(action);

            InitializeComponent();
            _PropertyGrid.SelectedObject = action;
            _PropertyGrid.Properties.Clear();
            foreach (var configProp in configPropCollection)
            {
                var item = new PropertyItem(_PropertyGrid, action, configProp);
                _PropertyGrid.Properties.Add(item);
            }
            foreach (var category in _PropertyGrid.Categories)
            {
                category.Comparer = new PropertyOrderComparer();
            }
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var collection = ConfigPropertyCollection.FromObject(value);

            return(collection.Count > 0 ? Visibility.Visible : Visibility.Collapsed);
        }