public Login_Page2ViewModel(INavigationService navigationService, IWebApiRestClient webApiRestClient) { _navigationService = navigationService; _webApiRestClient = webApiRestClient; userDBService = DependencyService.Get <IUserDBService>(); }
public NotificationsPageViewModel(INavigationService navigationService, IWebApiRestClient webApiRestClient) { _navigationService = navigationService; _webApiRestClient = webApiRestClient; toastMessage = DependencyService.Get <ToastMessage>(); notificationDBService = DependencyService.Get <INotificationDBService>(); AddNotify = new Command(add_click); var IsNotificationDBExist = notificationDBService.IsNotificationDbPresentInDB(); if (IsNotificationDBExist) { IEnumerable <NotificationModel> notifications = notificationDBService.ReadAllItems(); foreach (var item in notifications) { NotificationList.Add(item); } } MessagingCenter.Subscribe <string>(this, "Notification Recieved", (sender) => { var data = sender; var newjob = new NotificationModel() { Text = data, Icon = "logo.png", Time = "Now" }; NotificationList.Add(newjob); notificationDBService.CreateNotificationModeInDB(newjob); toastMessage.Show("You have recieved a new notification."); }); }
public SendOtpPageViewModel(INavigationService navigationService, IWebApiRestClient webApiRestClient) { try { _navigationService = navigationService; _webApiRestClient = webApiRestClient; MessagingCenter.Subscribe <string>(this, "OtpReceived", async(sender) => { ActivationCode = sender; UserDialogs.Instance.ShowLoading("Fetching Code"); await Task.Delay(500); OTP1 = ActivationCode[0].ToString(); OTP2 = ActivationCode[1].ToString(); OTP3 = ActivationCode[2].ToString(); OTP4 = ActivationCode[3].ToString(); UserDialogs.Instance.HideLoading(); }); MessagingCenter.Subscribe <string>(this, "OTPAutoFillComplete", async(sender) => { await _navigationService.NavigateAsync(new Uri("/MasterPage/NavigationPage/HomeTabbedPage", UriKind.Absolute)); }); } catch (Exception) { } }
public Login_Page2() { InitializeComponent(); _webApiRestClient = new WebApiRestClient(); MobileEntryTitle.Text = AppResources.MobileEntryTitle; MobileEntry.Placeholder = AppResources.LoginEntryPlaceHolder; NextButton.Text = ""; NextButton.IsEnabled = false; //getCountryCode(); countryCodeList.ItemSelected += CountryCodeList_ItemSelected; MessagingCenter.Subscribe <string>(this, "EntryFocus", (sender) => { MobileEntry.Focus(); }); }
public HomePageViewModel(INavigationService navigationService, IWebApiRestClient webApiRestClient) { try { _navigationService = navigationService; _webApiRestClient = webApiRestClient; HomePageCategorySelectedCommand = new Command(Categry_sel); InfoCommand = new Command(Info_Command); TitleText = AppResources.MereNear; GetCategoryApi(); GetWorkerData(); WorkerDetail = CategoryDataList.ElementAt(0).WorkerInformation; WorkerName = CategoryDataList.ElementAt(0).WorkerName; WorkerCategoryName = CategoryDataList.ElementAt(0).WorkerName; } catch (Exception) { } }