예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            recipeSource  = new FileRecipeSource();
            recipeHistory = new FileRecipeHistory();

            HelperService.Initialize(recipeSource, recipeHistory);

            // Inicjalizacja kontrolek.
            RecipeList recipeList = FindName("RecipeList") as RecipeList;

            recipeList.Initialize(recipeSource);

            _SearchBar.QueryChanged += recipeList.Filter;
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            recipeSource  = new FileRecipeSource();
            recipeHistory = new FileRecipeHistory();

            HelperService.Initialize(recipeSource, recipeHistory);

            // Inicjalizacja kontrolek.
            RecipeList recipeList = FindName("RecipeList") as RecipeList;

            recipeList.Initialize(recipeSource);

            //TODO: Powiązać eventy/handlery
        }
예제 #3
0
        public VineCreator(Recipe recipe, IRecipeHistory recipeHistory)
        {
            this.recipe        = recipe;
            this.recipeHistory = recipeHistory;

            InitializeComponent();

            // Binding nazwy i opisu w XAMLu
            this.DataContext = recipe;

            ingredientComboBox.Items.Add("Nastaw");

            foreach (var i in recipe.Ingredients)
            {
                ingredientComboBox.Items.Add(i.Name);
            }

            ingredientComboBox.SelectedIndex = 0;

            // Ustaw grid pod model reprezentujący ilość składników
            var grid = new GridView();

            ingredientsList.View = grid;

            grid.Columns.Add(new GridViewColumn
            {
                Header = "Nazwa",
                DisplayMemberBinding = new Binding("Name")
            });

            grid.Columns.Add(new GridViewColumn
            {
                Header = "Ilosc",
                DisplayMemberBinding = new Binding("Ammount")
            });

            comment.Visibility = Visibility.Hidden;
        }
예제 #4
0
 /// <summary>
 /// Załaduj i wyświetl plik pomocy (*.chm).
 /// </summary>
 public static void Initialize(IRecipeSource recipeSource, IRecipeHistory recipeHistory)
 {
     HelperService.recipeSource  = recipeSource;
     HelperService.recipeHistory = recipeHistory;
 }
예제 #5
0
 public void Initialize(IRecipeHistory history)
 {
     historyView.ItemsSource = history.Batches;
 }