List DataBinding

Data binding is the process that establishes a connection between the application UI and business logic.

Let's create another xaml called LiskTaskPage. The idea is throw the collection of ToDoItems that already added to the LiskTaskPage.

On ListTaskPage.xaml.cs.

public List<ToDoItem> ToDoItems { get; set; }

public ListTaskPage (List<ToDoItem> items)
{
    ToDoItems = items;
    BindingContext = this;
    InitializeComponent ();
}

If we want able to click on the list item, we could create a function as shown below.

private void OnSelected(object sender, ItemTappedEventArgs e)
{
    var ToDoItems = e.Item as ToDoItem;
    DisplayAlert("CHoosen!", ToDoItems.TaskName + "was selected!", "OK");
}

results matching ""

    No results matching ""