Пример #1
0
 private void SelectAlertItem(AlertItemViewModel alertItem)
 {
     if (AmountAlertIndicator > 0)
     {
         AmountAlertIndicator--;
     }
     mCacheService.AlertItem = alertItem;
     //
     if (alertItem.Alert.ProjectId == null)
     {
         // direct alert
         ShowViewModel <AlertDetailViewModel>();
     }
     else
     {
         if (HomeVM.ProfileVM.UserProfileCompleted())
         {
             mCacheService.AlertItems = mAlertItems;
             ShowViewModel <AlertInviteViewModel>();
         }
         else
         {
             mMessageboxService.ShowToast("You must complete your personal profile first!");
         }
     }
 }
Пример #2
0
        private void InitData()
        {
            var alert = new Alert();

            alert.Title = "Test swipes";
            var alertItem = new AlertItemViewModel(alert);

            AlertItems = new MvxObservableCollection <AlertItemViewModel>();

            AlertItems.Add(alertItem);
        }
Пример #3
0
 public void FlagAlertItem(AlertItemViewModel alertItem)
 {
     if (alertItem.Alert.Read != null)
     {
         AmountAlertIndicator++;
         return;
     }
     else if (alertItem.Alert.Read == null)
     {
         AmountAlertIndicator--;
         return;
     }
 }
Пример #4
0
 public void DeleteAlertItem(AlertItemViewModel alertItem)
 {
     if (alertItem.Alert.Read == null)
     {
         if (AmountAlertIndicator > 0)
         {
             AmountAlertIndicator--;
         }
     }
     mAlertItemsStatic.Remove(alertItem);
     AlertItems.Remove(alertItem);
     RaisePropertyChanged("Title");
 }
Пример #5
0
        public async void LoadData(bool resetTextSearch = true)
        {
            AmountAlertIndicator = 0;
            mPlatformService.ShowNetworkIndicator();
            //mProgressDialogService.ShowProgressDialog();

            var response = await mApiService.GetAlertList();

            foreach (var item in response.Data)
            {
                if (item.Read == null)
                {
                    AmountAlertIndicator++;
                }
            }

            mPlatformService.HideNetworkIndicator();
            //mProgressDialogService.HideProgressDialog();

            mAlertItemsStatic.Clear();

            if (response.Data != null)
            {
                response.Data.Sort((Alert x, Alert y) => 0 - x.Created.CompareTo(y.Created));;

                foreach (var alert in response.Data)
                {
                    AlertItemViewModel alertItem = new AlertItemViewModel(alert);
                    alertItem.AlertsVM = this;
                    mAlertItemsStatic.Add(alertItem);
                }
            }

            if (resetTextSearch)
            {
                TextSearch = "";
            }
            else
            {
                TextSearch = TextSearch;
            }
            RaisePropertyChanged("IsHaveAlerts");
            RaisePropertyChanged("Title");
        }