public LoginViewModel(IPageService pageService) { this.pageService = pageService; restServices = new RestServices(); User = new User(); AuthenticateViaFacebook = new Command(async() => await FacebookLoginAsync()); AuthenticateUserViaManual = new Command(async() => await AuthenticateUser()); GoToRegisterPage = new Command(async() => await NaviagateToRegisterPage()); }
public VehicleViewModel(IPageService pageService, Vehicle vehicle, string userId) { restServices = new RestServices(); this.pageService = pageService; this.vehicle = vehicle; this.vehicle.VehicleType = "Bike"; this.vehicle.VehicleModel = "2018"; SubmitCommand = new Command(async() => await AddVehcicle()); }
public TyreViewModel(IPageService pageService, string authToken) { restServices = new RestServices(); this.pageService = pageService; Task.Run(async() => { VehicleList = await restServices.GetVehicleList((Application.Current as App).UserAuthToken); VehicleNoList = VehicleList.Select(l => l.VehicleNo).ToList(); }); SameTyre = new Tyre(); DifferentTypeTyre = new DifferentTypeTyre { FrontTyre = new Tyre(), RearTyre = new Tyre() }; TyreStatusList = new List <string>() { CommonConstants.NewTyreType, CommonConstants.OldTyreType }; SubmitCommand = new Command <string>(async(type) => await Submit(type)); }
public VehicleListViewModel(IPageService pageService) { this.pageService = pageService; restServices = new RestServices(); AddNewVehicle = new Command <Vehicle>((v) => GoToVehicleManageView(new Vehicle())); }