private async void DeleteAddress(UserData obj)
        {
            try
            {
                if (obj != null)
                {
                    await ShowLoader(true);

                    DatabaseService.DeleteItem(obj.ID);
                    await ClosePopup();

                    UserList = DatabaseService.GetAll();
                    var sorted = UserList.OrderBy(item => item.Name).GroupBy(item => item.Name[0].ToString())
                                 .Select(itemGroup => new Grouping <string, UserData>(itemGroup.Key.ToUpper(), itemGroup)).ToList();
                    Items            = new FlowObservableCollection <object>(sorted);
                    IsVisibleMessage = Items.Count > 0 ? false : true;
                }
            }
            catch (Exception ex)
            {
                await ClosePopup();

                TelemetryService.Instance.Record(ex);
            }
        }
Exemplo n.º 2
0
        public new void ReloadData()
        {
            var exampleData = new List <SimpleItem>();

            var random  = new Random(DateTime.Now.Millisecond);
            var howMany = 60;

            TotalRecords = 120;

            for (int i = 0; i < howMany; i++)
            {
                exampleData.Add(new SimpleItem()
                {
                    Title = Guid.NewGuid().ToString("N").Substring(0, 8)
                });
            }

            var sorted = exampleData
                         .OrderBy(item => item.Title)
                         .GroupBy(item => item.Title[0].ToString())
                         .Select(itemGroup => new Grouping <string, SimpleItem>(itemGroup.Key, itemGroup, random.Next(1, 6)))
                         .ToList();

            sorted.Insert(0, new Grouping <string, SimpleItem>("-"));

            Items = new FlowObservableCollection <object>(sorted);
        }
        private void SearchContact(string searchtxt, CancellationToken token)
        {
            try
            {
                UserList = DatabaseService.GetAll();
                if (searchtxt.Count() > 0)
                {
                    var sorted = UserList.Where(c => c.Name.ToLower().Contains(searchtxt.ToLower()))
                                 .OrderBy(item => item.Name)
                                 .GroupBy(item => item.Name[0].ToString())
                                 .Select(itemGroup => new Grouping <string, UserData>(itemGroup.Key.ToUpper(), itemGroup))
                                 .ToList();
                    Items = new FlowObservableCollection <object>(sorted);
                }
                else
                {
                    var sorted = UserList
                                 .OrderBy(item => item.Name)
                                 .GroupBy(item => item.Name[0].ToString())
                                 .Select(itemGroup => new Grouping <string, UserData>(itemGroup.Key.ToUpper(), itemGroup))
                                 .ToList();
                    Items = new FlowObservableCollection <object>(sorted);
                }

                IsVisibleMessage = Items.Count > 0 ? false : true;
            }
            catch (Exception ex)
            {
                TelemetryService.Instance.Record(ex);
            }
        }
Exemplo n.º 4
0
 public DetalhesDosUsuarioViewModel(INavigationService serviceNavigation)
 {
     ItensMenu          = new FlowObservableCollection <MateriaisModel>();
     _service           = new MenuService();
     _serviceNavigation = serviceNavigation;
     CarregarMenu();
 }
Exemplo n.º 5
0
        public CreateAcounteViewModel(INavigationService serviceNavigation)
        {
            _serviceNavigation = serviceNavigation;
            _service           = new CreateAccountService();
            Message            = new FlowObservableCollection <MessageRegistrationModel>();
            User    = new UserModel();
            loading = new PopUpLoadingMessageView();

            IsEntry         = "false";
            IsButtonTerm    = "false";
            IsButtonConfirm = "false";

            _ = InitialMessage();

            Message.CollectionChanged += (sender, e) =>
            {
                Page     currentPage = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault();
                ListView listView    = currentPage.FindByName <ListView>("MessagesListView");
                var      target      = Message[Message.Count - 1];

                if (Device.RuntimePlatform == Device.iOS)
                {
                    listView.ScrollTo(target, ScrollToPosition.MakeVisible, true);
                }
                else if (Device.RuntimePlatform == Device.Android)
                {
                    listView.ScrollTo(target, ScrollToPosition.Start, true);
                }
            };
        }
Exemplo n.º 6
0
 public ListCategoriesPageModel()
 {
     Title               = Constants.AppName;
     Items               = new FlowObservableCollection <CategoryListVm>();
     LoadItemsCommand    = new Command(async() => await ExecuteLoadItems());
     ItemSelectedCommand = new Command <ViewModels.CategoryListVm>(async(item) => await ExecuteItemSelected(item));
 }
Exemplo n.º 7
0
 public MenuViewModel(INavigationService serviceNavigation)
 {
     ItensMenu          = new FlowObservableCollection <MenuModel>();
     service            = new MenuService();
     _serviceNavigation = serviceNavigation;
     CarregarMenu();
 }
Exemplo n.º 8
0
 public override void Reset()
 {
     base.Reset();
     ListChallengesPer  = new FlowObservableCollection <ChallengeInfo>();
     ListChallengesClub = new FlowObservableCollection <ChallengeInfo>();
     count = 0;
 }
Exemplo n.º 9
0
        public MainInfoViewModel(INavigationService serviceNavigation)
        {
            ItensMenu          = new FlowObservableCollection <MateriaisModel>();
            _service           = new MenuService();
            _serviceNavigation = serviceNavigation;
            Data = new BaseData();

            if (App.GetUser.Image == null)
            {
                App.GetUser.Image = "img_Default.png";
            }

            if (App.GetUser.IsCollector)
            {
                buttonCollector = false;
            }
            else
            {
                buttonCollector = true;
            }

            user = App.GetUser;

            CarregarMenu();
        }
 public HistoricoViewModel(INavigationService serviceNavigation, IProntuarioService prontuarioService)
 {
     _serviceNavigation = serviceNavigation;
     _prontuarioService = prontuarioService;
     ItensHistorico     = new FlowObservableCollection <ProntuarioModel>();
     CarregarHistorico();
 }
Exemplo n.º 11
0
 public ListaDeUsuariosViewModel(INavigationService serviceNavigation)
 {
     _serviceNavigation = serviceNavigation;
     Usuarios           = new FlowObservableCollection <UserModel>();
     _service           = new UsuariosService();
     _ = CarregarListaUsuarios();
 }
Exemplo n.º 12
0
 public override void Reset()
 {
     base.Reset();
     IsShow      = true;
     Images      = new FlowObservableCollection <ImageNews>();
     contentPost = new ContentInfo();
 }
Exemplo n.º 13
0
        private static void loadMediaIntoCollection()
        {
            List <DayMediaObservableCollection> days = new List <DayMediaObservableCollection>(MediaManager.allMediaDict.Values);

            days.Reverse();

            allMediaCollection = new FlowObservableCollection <DayMediaObservableCollection>(days);
        }
Exemplo n.º 14
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();
        }
Exemplo n.º 15
0
 public HomeViewModel(IServiceNavigation navigation, IServiceMessage message)
 {
     _navigation = navigation;
     _message    = message;
     _service    = new MenuService();
     ItensMenu   = new FlowObservableCollection <MenuModel>();
     LoadItensMenu();
 }
 public override void Reset()
 {
     images = new FlowObservableCollection <ImageNews>();
     if (Helper.Instance().CheckLogin())
     {
         personalPost = new PersonalPost()
         {
             urlAvarta = Helper.Instance().MyAccount.Avatar_Uri,
             fullName  = Helper.Instance().AccountChat.FullName
         };
     }
 }
Exemplo n.º 17
0
        public ListChallengeVM()
        {
            ListChallAcc  = new FlowObservableCollection <ChallengeInfo>();
            ListChallClub = new FlowObservableCollection <ChallengeInfo>();

            foreach (var item in ChallengeAction.ListAccRecive)
            {
                ListChallAcc.Add(item.Value);
            }
            foreach (var item in ChallengeAction.ListClubRecive)
            {
                ListChallClub.Add(item.Value);
            }
        }
Exemplo n.º 18
0
        public async void refreshList()
        {
            var newFavsList = await App.FavRepo.GetFavs();

            FlowObservableCollection <Favourite> newFavs = new FlowObservableCollection <Favourite>();

            foreach (var fav in newFavsList)
            {
                if (newFavs.All(x => x.clubId != fav.clubId))
                {
                    newFavs.Add(fav);
                }
            }
            favList.FlowItemsSource = newFavs;
        }
 public BContext()
 {
     List = new FlowObservableCollection <Foo>
     {
         new Foo {
             BgImage  = "http://via.placeholder.com/350x150",
             Title    = "Title",
             Subtitle = "SubTitle"
         },
         new Foo {
             BgImage  = "http://via.placeholder.com/350x150",
             Title    = "Title1",
             Subtitle = "SubTitle1"
         }
     };
 }
Exemplo n.º 20
0
 /// <summary>
 /// get all task from db
 /// grouped the task base on their task type
 /// set task to FlowObservableCollection to display on UI
 /// </summary>
 public void SortedAndSetTheTaskList()
 {
     try
     {
         var s      = databaseHelper.GetAllTaskks();
         var sorted = databaseHelper.GetAllTaskks()
                      .GroupBy(item => item.TaskType)
                      .Select(itemGroup => new Grouping <string, Taskk>(itemGroup.Key, itemGroup))
                      .ToList();
         Items = new FlowObservableCollection <Grouping <string, Taskk> >(sorted);
     }
     catch (Exception ex)
     {
         MessagingCenter.Send((App)Xamarin.Forms.Application.Current, AppConstant.ErrorEvent, ex.ToString());
     }
 }
        public void ReloadData()
        {
            var exampleData = new List <object>();

            var howMany = 120;

            for (int i = 0; i < howMany; i++)
            {
                exampleData.Add(new SimpleItem()
                {
                    Title = string.Format("Item nr {0}", i)
                });
            }

            Items = new FlowObservableCollection <object>(exampleData);
        }
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);
            try
            {
                UserList = DatabaseService.GetAll();

                var sorted = UserList
                             .OrderBy(item => item.Name)
                             .GroupBy(item => item.Name[0].ToString())
                             .Select(itemGroup => new Grouping <string, UserData>(itemGroup.Key.ToUpper(), itemGroup))
                             .ToList();

                Items            = new FlowObservableCollection <object>(sorted);
                IsVisibleMessage = Items.Count > 0 ? false : true;
            }
            catch (Exception ex)
            {
                TelemetryService.Instance.Record(ex);
            }
        }
Exemplo n.º 23
0
 public override void Reset()
 {
     ListChallAcc  = new FlowObservableCollection <ChallengeInfo>();
     ListChallClub = new FlowObservableCollection <ChallengeInfo>();
 }
Exemplo n.º 24
0
 public ListChallengePageVM()
 {
     ListChallengesPer  = new FlowObservableCollection <ChallengeInfo>();
     ListChallengesClub = new FlowObservableCollection <ChallengeInfo>();
 }
Exemplo n.º 25
0
 public void make_orderbook_obj() //List<object> o)
 {
     tradepage_orderbook_obj = new FlowObservableCollection <object>(this.orderbook_data);
 }
Exemplo n.º 26
0
        private async void GetDataMethodAsync(object obj)
        {
            var data = await webServices.GetListDetailsAsync <ItemDetailsModel>(obj as string);

            ListOfData = new FlowObservableCollection <ItemDetailsModel>(data);
        }
Exemplo n.º 27
0
 public UpLoadImageVM()
 {
     Images      = new FlowObservableCollection <ImageNews>();
     IsShow      = true;
     contentPost = new ContentInfo();
 }