public CategoriesListPage(ProjectViewModel project) { //Set the view model of the page. Since this is the Projects List page, use that view model. var binding = new CategoriesListViewModel((IApplication)Application.Current, project); BindingContext = binding; ToolbarItems.Add(new ToolbarItem("New Task", "add-task.png", async () => { await Navigation.PushAsync(new TaskDetailsPage()); })); InitializeComponent(); }
public CategoriesListPage(ProjectViewModel project) { //Set the view model of the page. Since this is the Projects List page, use that view model. var binding = new CategoriesListViewModel((IApplication)Application.Current, project); BindingContext = binding; var addButton = new ToolbarItem (); addButton.Text = "New Task"; addButton.Icon = "add-task.png"; addButton.Command = binding.OpenNewTask; ToolbarItems.Add(addButton); InitializeComponent(); }