The logical model for the 'PropertyGrid' view.
Inheritance: ViewModelBase
        public void ShouldClearCategoriesWhenSelectedObjectSetToNull()
        {
            var model = new PropertyGridViewModel {SelectedObject = new Sample1()};
            model.Categories.Count.ShouldNotBe(0);

            model.SelectedObject = null;
            model.Categories.Count.ShouldBe(0);
        }
        public void ShouldDestroyOldCategories()
        {
            var model = new PropertyGridViewModel { SelectedObject = new Sample1() };
            var propViewModel = model.Categories[0].GridViewModel.Properties[0];

            propViewModel.IsDestroyed.ShouldBe(false);

            model.SelectedObject = null;

            propViewModel.IsDestroyed.ShouldBe(true);
        }
        public void ShouldPopulateCategoriesFromAttributeWhenSelectedObjectSet()
        {
            var model = new PropertyGridViewModel();
            model.SelectedObject.ShouldBe(null);
            model.Categories.Count.ShouldBe(0);

            model.SelectedObject = new Sample1();
            model.Categories.Count.ShouldBe(2);

            model.Categories.FirstOrDefault(item => item.CategoryName == "Miscellaneous").ShouldNotBe(null);
        }
 public PropertyExplorerViewModel()
 {
     GridViewModel = new PropertyGridViewModel();
 }
 public PropertyGrid()
 {
     Templates.Instance.ApplyTemplate(this);
     ViewModel = new PropertyGridViewModel();
 }