/// <summary> /// Initializes component. /// Adds handler for "ItemTapped" event. /// Sets "SelectedItem" to first Pin from collection. /// </summary> public PinsList() { InitializeComponent(); BindingContext = _viewModel; ItemTapped += _viewModel.OnItemSelected; SelectedItem = _viewModel.GetFirstPin(); }