示例#1
0
        //combine multiple VMs into a VM of Dictionaries that gets serialized in the view
        public ActionResult SecondIndex()
        {
            var firstVM = new FirstVM
            {
                Greeting = "Hello World"
            };
            var secondVM = new FirstVM
            {
                Greeting = "Foo"
            };
            var thirdVM = new FirstVM
            {
                Greeting = "Bar"
            };
            var fourthVM = new SecondVM
            {
                Bye = "Goodbye World"
            };

            var vue     = new Vue();
            var vueData = new CombinedDataVM
            {
                ModelOneData   = vue.ParseData(firstVM),
                ModelTwoData   = vue.ParseData(secondVM),
                ModelThreeData = vue.ParseData(thirdVM),
                ModelFourData  = vue.ParseData(fourthVM)
            };

            return(View(vueData));
        }
        private void RefreshView()
        {
            var secondVM = new SecondVM();

            DataContext = null;
            DataContext = secondVM;
        }
示例#3
0
        public Locator()
        {
            FirstVM = new FirstVM(model)
            {
                Text   = "Начало !!!",
                Number = 12345
            };

            SecondVM = new SecondVM(model);
        }