Example #1
0
        private void SelectTabAlerts()
        {
            UnSelectAllTabs();
            IsTabAlertsSelected = true;
            View.SwitchToTab(HomeTab.Alerts);

            if (mIsAlertsNeedLoad)
            {
                mIsAlertsNeedLoad = false;
                AlertsVM.LoadData(false);
            }
        }
Example #2
0
 private void HandleAppStateAction(ChangeAppStateMessage obj)
 {
     if (obj.AppState == AppState.Active)
     {
         // get alert background and count
         if (AlertsVM != null)
         {
             AlertsVM.LoadData(false);
         }
     }
     else if (obj.AppState == AppState.InActive)
     {
     }
 }
Example #3
0
        private async Task FlagAlert()
        {
            Mvx.Resolve <IPlatformService>().ShowNetworkIndicator();
            Mvx.Resolve <IProgressDialogService>().ShowProgressDialog();

            if (Alert.Read != null)
            {
                var response = await Mvx.Resolve <IApiService>().SettingAlert(mAlert.Id, null, null);

                Mvx.Resolve <IPlatformService>().HideNetworkIndicator();
                Mvx.Resolve <IProgressDialogService>().HideProgressDialog();

                AlertsVM.FlagAlertItem(this);

                if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.NoContent)
                {
                    mAlert.Read = null;
                    RaisePropertyChanged("IsRead");
                    AlertsVM.RaisePropertyChanged("Title");

                    int idx = AlertsVM.AlertItems.IndexOf(this);
                    AlertsVM.View.CloseOptionsOnAlert(idx);
                }
                return;
            }
            if (Alert.Read == null)
            {
                DateTimeOffset read     = DateTimeOffset.Now;
                var            response = await Mvx.Resolve <IApiService>().SettingAlert(mAlert.Id, read, null);

                Mvx.Resolve <IPlatformService>().HideNetworkIndicator();
                Mvx.Resolve <IProgressDialogService>().HideProgressDialog();

                AlertsVM.FlagAlertItem(this);

                if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.NoContent)
                {
                    mAlert.Read = read;
                    RaisePropertyChanged("IsRead");
                    AlertsVM.RaisePropertyChanged("Title");

                    int idx = AlertsVM.AlertItems.IndexOf(this);
                    AlertsVM.View.CloseOptionsOnAlert(idx);
                }
                return;
            }
        }
Example #4
0
        private async Task DeleteAlert()
        {
            if (this.Alert != null && AlertsVM != null)
            {
                Mvx.Resolve <IPlatformService>().ShowNetworkIndicator();
                Mvx.Resolve <IProgressDialogService>().ShowProgressDialog();

                var response = await Mvx.Resolve <IApiService>().SettingAlert(mAlert.Id, mAlert.Read, DateTimeOffset.Now);

                Mvx.Resolve <IPlatformService>().HideNetworkIndicator();
                Mvx.Resolve <IProgressDialogService>().HideProgressDialog();

                if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.NoContent)
                {
                    AlertsVM.DeleteAlertItem(this);
                }
            }
        }