private async void CustomerDetail()
        {
            var customerItemViewModel = new CustomerItemViewModel
            {
                Address          = Address,
                City             = City,
                CityId           = CityId,
                CompanyCustomers = CompanyCustomers,
                CustomerId       = CustomerId,
                Department       = Department,
                DepartmentId     = DepartmentId,
                FirstName        = FirstName,
                IsUpdated        = IsUpdated,
                LastName         = LastName,
                Latitude         = Latitude,
                Longitude        = Longitude,
                Orders           = Orders,
                Phone            = Phone,
                Photo            = Photo,
                Sales            = Sales,
                UserName         = UserName
            };
            //COMO CREO  UNA INSTANCIA DE LA MAIN VIEW MODEL QUE YA ESTA INSTANCIADA

            var mainViewModel = MainViewModel.GetInstance();//obtenemos una instacia del mainview model por que a ella

            //le tengo que establecer el usuario
            mainViewModel.SetCurrentCustomer(customerItemViewModel);
            await navigationService.Navigate("CustomerDetailPage");//el servicio de navegacion pinta la pagina
        }
Beispiel #2
0
        public MainViewModel()
        {
            //esto es para SingletoN
            instance = this;

            //Create observable collections
            Menu     = new ObservableCollection <MenuItemViewModel>();
            Products = new ObservableCollection <ProductItemViewModel>();
            //customers
            Customers = new ObservableCollection <CustomerItemViewModel>();
            Pins      = new ObservableCollection <Pin>();


            //Create Views
            NewLogin        = new LoginViewModel();
            UserLoged       = new UserViewModel();
            CurrentCustomer = new CustomerItemViewModel();
            NewCustomer     = new CustomerItemViewModel();

            //Instance services
            dataService = new DataService();

            //ecommerce 116 para productos
            apiService = new ApiService();

            //esto es para networking 117 ecommerce
            netService = new NetService();

            //navigation service
            navigationService = new NavigationService();

            //Load Data
            LoadMenu();
            // LoadUser();//ECommerce 113, al inicio no tengo usuario es un coletaso del logeo anterior no del de ahora y para solucionarlo
            //para ello creo un Singleton que es una clase statica para instanciar algun metodo.
            LoadProducts();

            LoadCustomers();
        }
Beispiel #3
0
 public void SetCurrentCustomer(CustomerItemViewModel customerItemViewModel)
 {
     CurrentCustomer = customerItemViewModel;
 }