Ejemplo n.º 1
0
        private async void CheckForUpdate()
        {
            int oldCount = 0;

            while (true)
            {
                if (QueryList != null && QueryList.Count() != oldCount)
                {
                    oldCount = QueryList.Count();
                    _realm.Write(() =>
                    {
                        PlayersList = new ObservableCollection <POTYModel>(QueryList.ToList());
                        int i       = 0;
                        foreach (POTYModel item in PlayersList)
                        {
                            item.Index = i++;
                        }
                        OnPropertyChanged(nameof(PlayersList));
                    });
                }
                await Task.Delay(100);
            }
        }