Exemplo n.º 1
0
        //remove item
        private async void RemoveItems_Command(object sender, EventArgs e)
        {
            var movitem = _viewModel.DatasetCharacter.FirstOrDefault(a => a.Id == player).RemoveItem((ItemLocationEnum)Enum.Parse(typeof(ItemLocationEnum), mode));

            PoolSet.Add(movitem);
            _viewModel.Dataset.Add(movitem);
            _viewModel.clean();
            CurrentItem.Text = _viewModel.DatasetCharacter.FirstOrDefault(a => a.Id == player).GetItemAtLocation((ItemLocationEnum)Enum.Parse(typeof(ItemLocationEnum), mode));

            RemoveItem.IsEnabled = true;
        }
Exemplo n.º 2
0
        //items select
        void OnItemChosen(object sender, EventArgs args)
        {
            Picker picker = (Picker)sender;
            Item   temp   = (Item)picker.SelectedItem;

            if (temp == null)
            {
                return;
            }
            var movitem = _viewModel.DatasetCharacter.FirstOrDefault(a => a.Id == player).RemoveItem((ItemLocationEnum)Enum.Parse(typeof(ItemLocationEnum), mode));

            PoolSet.Add(movitem);
            _viewModel.Dataset.Add(movitem);
            _viewModel.DatasetCharacter.FirstOrDefault(a => a.Id == player).AddItem((ItemLocationEnum)Enum.Parse(typeof(ItemLocationEnum), mode), temp.Id);
            PoolSet.Remove(temp);
            _viewModel.Dataset.Remove(temp);
            _viewModel.clean();
            PoolSet              = PoolSet.Where(x => x != null).ToList();
            CurrentItem.Text     = _viewModel.DatasetCharacter.FirstOrDefault(a => a.Id == player).GetItemAtLocation((ItemLocationEnum)Enum.Parse(typeof(ItemLocationEnum), mode));
            RemoveItem.IsEnabled = true;
        }