public static ObservableCollection <IPkmnType> PopulateComboboxPkmnTypeList() { ObservableCollection <IPkmnType> output = GeneratePkmnTypeList(); output.Insert(0, CreatePkmnTypeViewModel(PkmnTypeFactory.CreateEmptyPkmnType())); return(output); }
public IndexModel(ILogger <IndexModel> logger) { _logger = logger; // add empty pkmn types to the comboboxes PrimaryPkmnTypeList.Insert(0, PkmnTypeFactory.CreateEmptyPkmnType()); SecondaryPkmnTypeList.Insert(0, PkmnTypeFactory.CreateEmptyPkmnType()); }
// form constructor public PokemonTypeCalculatorForm() { InitializeComponent(); // add empty pkmn types to the comboboxes PrimaryPkmnTypeList.Insert(0, PkmnTypeFactory.CreateEmptyPkmnType()); SecondaryPkmnTypeList.Insert(0, PkmnTypeFactory.CreateEmptyPkmnType()); // set the collection properties as datasources for the comboboxes primaryTypeComboBox.DataSource = PrimaryPkmnTypeList; secondaryTypeComboBox.DataSource = SecondaryPkmnTypeList; // set the name of the pokemon type as a displayed value for comboboxes primaryTypeComboBox.DisplayMember = "TypeName"; secondaryTypeComboBox.DisplayMember = "TypeName"; // set the collection for list view pkmnTypeObjectListView.SetObjects(PkmnTypeList); // set focus on damage taken button showDamageTakenButton.Select(); }