public ShipSelector(PlayerShip[] ships) { if (ships != null) { Ships = new ObservableCollection<string>(); foreach (PlayerShip ship in ships) { Ships.Add(ship.Name.Value); } } InitializeComponent(); if (lstShips.Items.Count > 0) { lstShips.SelectedIndex = 0; } }
public void GetShipSelection(PlayerShip[] shipList) { ships = shipList; this.Dispatcher.BeginInvoke(new Action(UserShipSelect)); }