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; }
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 }
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; }
/// <summary> /// Załaduj i wyświetl plik pomocy (*.chm). /// </summary> public static void Initialize(IRecipeSource recipeSource, IRecipeHistory recipeHistory) { HelperService.recipeSource = recipeSource; HelperService.recipeHistory = recipeHistory; }
public void Initialize(IRecipeHistory history) { historyView.ItemsSource = history.Batches; }