public TCW(string aBSExportFilename, FermentableRepository aMaltRepo, HopsRepository aHopsRepo) { InitializeComponent(); this.MaltsRepo = aMaltRepo; this.HopsRepo = aHopsRepo; FermentablesObservableList = new ObservableCollection <FermentableAdjunct>(aMaltRepo.Get()); HopsObservableList = new ObservableCollection <Hops>(aHopsRepo.Get()); BeersmithImporter = new BSImporter(aBSExportFilename); RecipeNameCombobox.ItemsSource = BeersmithImporter.GetAllRecipes(); RecipeNameCombobox.SelectedIndex = 0; HopsListView.ItemsSource = HopsObservableList; MaltsListView.ItemsSource = FermentablesObservableList; WorkRecepie = new Recepie(); }
public AlterHopsWindow(HopsRepository aRepo) { InitializeComponent(); Repo = aRepo; Hopses = new ObservableCollection <Hops>(); var fList = Repo.Get(); foreach (Hops x in fList) { Hopses.Add(x); } listView.ItemsSource = Hopses; CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(listView.ItemsSource); view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); }