Ejemplo n.º 1
0
 public async void RefreshListBag()
 {
     await Task.Run(() =>
     {
         var taskListBag = _diceDataBase.GetBagAsync();
         var listBag     = taskListBag.Result;
         ListBag.Clear();
         foreach (var item in listBag)
         {
             ListBag.Add(item);
         }
     });
 }
Ejemplo n.º 2
0
        private void CreateBagState()
        {
            if (Bag == null || Bag.ID == 0)
            {
                var taskBag = _diceDataBase.GetBagAsync(false);
                taskBag.Wait();

                var list = taskBag.Result;
                if (list != null && list.Count > 0)
                {
                    Bag = list.FirstOrDefault();
                }
                else
                {
                    Bag        = new Bag();
                    Bag.Active = false;
                    SaveBag();
                }
                LoadDataToObject();
            }
        }