Exemplo n.º 1
0
        private async void GetUsers()
        {
            var temp = await FBClient
                       .Child("users")
                       .OrderByKey()
                       .OnceAsync <UserModel>();

            await App.Current.Dispatcher.BeginInvoke((Action) delegate() { DbUsers.Clear(); });

            foreach (var e in temp)
            {
                await App.Current.Dispatcher.BeginInvoke((Action) delegate()
                {
                    DbUsers.Add(new UserModel {
                        Key = e.Key, Name = e.Object.Name
                    });
                });
            }

            //await App.Current.Dispatcher.BeginInvoke((Action)delegate () { StrCollection.Clear(); });

            //foreach (var e in temp)
            //{
            //    await App.Current.Dispatcher.BeginInvoke((Action)delegate ()
            //     {
            //         StrCollection.Add(e.Object.Name);
            //     });
            //}
        }