private void AddButton_Click(object sender, RoutedEventArgs e) { Data.AddElement(new Room { RoomName = NameTextBox.Text, RoomAdress = AdressTextBox.Text, Description = DescriptionTextBox.Text }); Data.UpdateRooms(); Close(); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (RoomsListBox.SelectedItem == null) { return; } RoomViewModel room = (RoomViewModel)RoomsListBox.SelectedItem; Data.DelElement(room); Data.UpdateRooms(); }