0

My code uses constructs like this:

<ViewCell Tapped="openPRTPage">

<ViewCell Tapped="openCVIPage">

In the code behind I have a method for each.

But is it possible to pass some parameter that I declare in the XAML to the back end code so that I could have just one method and use the parameter to decide which page gets opened?

Alan2
  • 23,493
  • 79
  • 256
  • 450
  • 3
    Check this thread: https://stackoverflow.com/questions/28985571/pass-object-in-click-tapped-event-handler-in-xamarin-forms – EvZ Dec 11 '17 at 11:48

1 Answers1

0

Using the MVVM pattern you could use a Command and a CommandParameter. Since it is not possible to use a Command on a ViewCell you will have to find a way to bind you event to command. Luckily it can be easily done using behaviours. There is an official guide on how to implement it.

EvZ
  • 11,889
  • 4
  • 38
  • 76