Example #1
0
 public HubView()
 {
     InitializeComponent();
     ViewLocator.Default    = new HubViewLocator();
     HubViewModel.Navigator = NavService;
     Loaded += (s, e) => HubViewModel.Initialize(null);
 }
Example #2
0
 public static Cats.Models.Hub BindHub(HubViewModel hubViewModel)
 {
     return(new Cats.Models.Hub()
     {
         HubID = hubViewModel.HubID,
         Name = hubViewModel.HubName,
         HubOwnerID = hubViewModel.HubOwnerID
     });
 }
Example #3
0
        public HubView()
        {
            InitializeComponent();
            ViewLocator.Default = new HubViewLocator();
            Vm.Navigator        = NavService;
            var vm = new HubViewModel {
                Navigator = NavService
            };

            DataContext = vm;
        }
Example #4
0
        public ActionResult Hub_Create([DataSourceRequest] DataSourceRequest request, HubViewModel hubViewModel)
        {
            var hub = new Hub();

            if (hubViewModel != null && ModelState.IsValid)
            {
                hub = HubViewModelBinder.BindHub(hubViewModel);
                _hubService.AddHub(hub);
            }
            return(Json(new[] { hub }.ToDataSourceResult(request, ModelState)));
        }
Example #5
0
 public HubPage()
 {
     InitializeComponent();
     BindingContext = _viewModel = App.Current.Services.GetService <HubViewModel>();
 }