private void move(Unit u, bool IsFirst) { if (IsFirst) { TradeList1.Remove(u); TradeList2.Add(u); if (u == Selected1) { Selected1 = null; traderList1.SelectedItem = null; itemsList1.ItemsSource = null; } } else { TradeList2.Remove(u); TradeList1.Add(u); if (u == Selected2) { Selected2 = null; traderList2.SelectedItem = null; itemsList2.ItemsSource = null; } } Update(); }
private void addWorldButton1_Click(object sender, RoutedEventArgs e) { string result = this.ShowModalInputExternal("Add someone from world", $"Type his name"); if (result != null && mainwindow.World.FirstOrDefault(x => x.Name.Contains(result)) != null) { TradeList1.Add(mainwindow.World.FirstOrDefault(x => x.Name.Contains(result))); Update(); } }
private void addGuildButton1_Click(object sender, RoutedEventArgs e) { string result = this.ShowModalInputExternal("Add guildian", $"Type his name"); if (result != null && mainwindow.SelectedGroup.Crew.FirstOrDefault(x => x.Name.Contains(result)) != null) { TradeList1.Add(mainwindow.SelectedGroup.Crew.FirstOrDefault(x => x.Name.Contains(result))); Update(); } }