private async void GetDataForRoadAsync(object obj)
 {
     await Task.Run(async() =>
     {
         dialogs.StartLoadingDialoge("Getting Data");
         if (!road.DataList.Any())
         {
             road.DataList = await webServices.GetListSubHomeMenuAsync <SubHomeMenuModel>(NavigationData.sub_menu[2]);
         }
         await Task.Delay(300);
         dialogs.HideLoadingDialogeAsync();
     });
 }
Пример #2
0
        public LoginViewModel(INavigationService _nav, IDialogs _dialogs, IWebServices _webServices)
        {
            Username = "******";
            Password = "******";

            #region Navigate To HomePage
            NavigatioHomePageCommand = new Command(async() => {
                _dialogs.StartLoadingDialoge("Logging in...");
                //Get user data
                var status = await GetUserDataAsync(Username, Password);
                if (status)
                {
                    //Application.Current.MainPage = new DetailsTabbedPage();
                    await _nav.NavigateToAsync <HomeViewModel>();
                }
                else
                {
                    _dialogs.HideLoadingDialogeAsync();
                }
            }, () => {
                return(IsActive);
            });

            #endregion

            #region Show Password Command
            ShowPasswordCommand = new Command(() => {
                ShowPass = !ShowPass;
            });
            #endregion

            webServices = _webServices;
        }
Пример #3
0
        private async void GetHomeMenuMethodAsync(object obj)
        {
            dialogs.StartLoadingDialoge("Getting Home Menu");
            var _ListOfMenu = await webServices.GetListHomeMenuAsync <HomeMenuModel>();

            ListOfMenu = new FlowObservableCollection <HomeMenuModel>(_ListOfMenu);
            dialogs.HideLoadingDialogeAsync();
        }