Button click event with current object from listview having button

 XAML


<StackLayout.GestureRecognizers>
              <TapGestureRecognizer
Command="{Binding Path=BindingContext.OnReadMoreClicked, Source={x:Reference Page}}" CommandParameter="{Binding .}" />
 </StackLayout.GestureRecognizers>

-----------------------------------
In ViewModel



  private Command<object> _onReadMoreClicked;
        public Command<object> OnReadMoreClicked
        {
            get
            {return _onReadMoreClicked ?? (_onReadMoreClicked = new Command<object>((currentObject) =>
                GetDetailsforRead(currentObject)
                ));
            }
        }

Comments

Popular posts from this blog

Listview SelectedItem in MVVM

SideMenu React native