Пример #1
0
        public AlterMaltsWindow(FermentableRepository aRepo)
        {
            InitializeComponent();

            Repo = aRepo;
            Fermentables = new ObservableCollection<FermentableAdjunct>();
            var fList = Repo.Get();
            foreach (FermentableAdjunct x in fList)
                Fermentables.Add(x);

            listView.ItemsSource = Fermentables;

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(listView.ItemsSource);
            view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
        }
Пример #2
0
        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();

        }