private void OKBtnClick(object sender, RoutedEventArgs e) { EditPlaceDatas datas = DataContext as EditPlaceDatas; m_wd.SQLDatabase.AddTreasure(datas.TreasureList); datas.Place.Story = ((TextBox)FindName("StoryText")).Text; m_wd.SQLDatabase.SetPlace(datas.Place); Close(); }
private void AddTreasureBtnClick(object sender, RoutedEventArgs e) { EditPlaceDatas datas = DataContext as EditPlaceDatas; TreasureItem ti = new TreasureItem { Treasure = new Treasure { PlaceName = datas.Place.Name }, TreasureID = datas.TreasureList.Count }; datas.TreasureList.Add(ti); }
public EditPlace(Place place, WindowData wd) { m_wd = wd; DataContext = new EditPlaceDatas(place, wd); InitializeComponent(); }