I need to bind the delete button appears in the Table View of the Mono touch to my command in my ViewModel?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way would be to change your MyItemType (used in the ViewModel’s collection) so that it has a
PleaseDeleteMeCommand, then call it like:Another way would be to add the command to the owning ViewModel instead.
Both ways could be adapted to use declarative data-binding if preferred – just bind the relevant ViewModel side ICommand to a client side property.
Obviously, you could also implement the same functionality using a custom button instead of the built-in table delete button – see the video http://slodge.blogspot.co.uk/2013/01/uitableviewcell-using-xib-editor.html for how the Pet Shop sells kittens (which involves deleting rows).