Example #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));
        }
Example #2
0
        private void Button_Clicked(object sender, EventArgs e)
        {
            Status.Text = txtName.Text + " - " + txtAge.Text;

            var abc = FirstVM.DoSomeDataAccess();

            Status.Text = abc;// txtName.Text + " - " + txtAge.Text;
        }
        public Locator()
        {
            FirstVM = new FirstVM(model)
            {
                Text   = "Начало !!!",
                Number = 12345
            };

            SecondVM = new SecondVM(model);
        }
Example #4
0
        private void Button_Clicked_1(object sender, EventArgs e)
        {
            string abc = FirstVM.AddRecord(int.Parse(txtAge.Text));

            Status.Text = abc;// txtName.Text + " - " + txtAge.Text;
        }