/** * Method managing the action of the "New" button * -> Request for a new random recipe to add to the list of recipes * -> Set the focus to the new added list * -> Refresh the content of the window * */ private void New_Click(object sender, RoutedEventArgs e) { ManageAPI.Request(); this.desired_id = ManageAPI.recipesList.Count - 1; this.Refresh(ManageAPI.recipesList.Count); }
/** * Initialize the main window * */ public MainWindow() { InitializeComponent(); ManageAPI.Request(); this.Refresh(ManageAPI.recipesList.Count); }