public PropertyGridTest2Control()
        {
            InitializeComponent();

            MyDateTime now = MyDateTime.FromDateTime(DateTime.Now);

            Components = new Component[]
            {
                CreateComponent("DateTime", now),
                CreateComponent("Matrix", TestMatrix.CreateIdentity()),
            };

            this.DataContext = this;
        }
Exemple #2
0
        private IViewModelNode CreateSampleTree()
        {
            MyDateTime now = MyDateTime.FromDateTime(DateTime.Now);

            var context   = new ViewModelContext(new ViewModelGlobalContext());
            var contextUI = new ViewModelContext(new ViewModelGlobalContext());

            context.ChildrenPropertyEnumerators.Add(new ChildrenPropertyInfoEnumerator());
            // add some more here...

            var testModel = new ViewModelNode("Root", now);

            var view = ObservableViewModelNode.CreateObservableViewModel(contextUI, testModel);

            ObservableViewModelNode.Refresh(contextUI, context, new ViewModelState());

            return(view);
        }