Example #1
0
        private async Task ExecuteLoadDataCommand()
        {
            // uncomment once crudi works i think
            //if(first)
            //{
            //    first = false;
            //    InitalLoadDataCommand();
            //}
            //else
            {
                if (IsBusy)
                {
                    return;
                }

                IsBusy = true;

                try
                {
                    CharacterDataset.Clear();
                    StartingPlayers.Clear();
                    var cData = ctrl.Players;
                    foreach (var data in cData)
                    {
                        StartingPlayers.Add(data);
                        CharacterDataset.Add(data);
                    }
                    MonsterDataset.Clear();
                    var mData = ctrl.Monsters;
                    foreach (var data in mData)
                    {
                        MonsterDataset.Add(data);
                    }
                }

                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }

                finally
                {
                    IsBusy = false;
                }
            }
        }
Example #2
0
        private async Task InitalLoadDataCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                CharacterDataset.Clear();
                var cData = await DataStore.GetAllAsync_Character(true);

                foreach (var data in cData)
                {
                    StartingPlayers.Add(data);
                    CharacterDataset.Add(data);
                }
                MonsterDataset.Clear();
                var mData = ctrl.Monsters;
                foreach (var data in mData)
                {
                    MonsterDataset.Add(data);
                }
            }

            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }

            finally
            {
                // temp cause crudi not working


                IsBusy = false;
            }
        }