public InventoryPage(EditCharacter page)//(Creature Data) { InitializeComponent(); // Set the data binding for the page BindingContext = _viewModel = ItemsViewModel.Instance; editPage = page;//page to assign items in edit character page character = page.Data; }
private void ListViewItemMouseDoubleClick(object sender, MouseButtonEventArgs e) { e.Handled = true; Character chara = ((ListViewItem)sender).Content as Character; EditCharacter ep = new EditCharacter(m_wd, chara); ep.ShowDialog(); m_wd.CharacterDatas.CharacterSelected = null; m_wd.CharacterDatas.CharacterSelected = chara; }
public async Task <IActionResult> EditCharacter(int id, [FromBody] EditCharacter data) { var character = await _context.Characters.FirstOrDefaultAsync(x => x.Id == id); if (character != null) { character.Name = data.Name; await _context.SaveChangesAsync(); return(Ok(character.Name)); } return(NotFound()); }
private void editCharacter_Click(object sender, EventArgs e) { EditCharacter editCharScreen = new EditCharacter(); editCharScreen.Show(); }