コード例 #1
0
        private ViewModelNavigationItem CreateNavigationItem(ViewModelInfo root)
        {
            var nav = new ViewModelNavigationItem(root);

            nav.OnNavigate += (sender, args) => SetAsCurrentVM(args.ViewModelInfo);
            return(nav);
        }
コード例 #2
0
        /// <inheritdoc />
        protected override void OnDesignMode()
        {
            base.OnDesignMode();
            NavigationStack = new AsyncObservableCollection <ViewModelNavigationItem>();
            ViewModels      = new AsyncObservableCollection <ViewModelNavigationItem>();

            var shellVM = new ViewModelNavigationItem(new ViewModelInfo(new ViewModelMock("ShellViewModel")
            {
                IsSelected = true
            }));
            var mainVM = new ViewModelNavigationItem(new ViewModelInfo(new ViewModelMock("MainViewModel")));

            shellVM.ViewModelInfo.ChildViewModels.Add(mainVM.ViewModelInfo);
            mainVM.ViewModelInfo.ParentViewModel = shellVM.ViewModelInfo;

            _mainpulator = new PropertyMainpulatorViewModel {
                Properties = new AsyncObservableCollection <IViewModelProperty>()
            };
            _viewModelManipulatorContent = new PropertyMainpulatorView {
                DataContext = _mainpulator
            };
            SetAsCurrentVM(shellVM.ViewModelInfo);
        }