Scenario:
I'm using a barcode scanner API in my view which seems to require me to hook up an event in the code-behind file as the only way to get the scanned barcode. When the barcode is scanned I want to pass the data on to the view model but since I want to follow the MVVM pattern I don't want a reference to the view model from my code-behind.
Right now I solved it by using the built in MessagingCenter.
Since the subview is showing within another view, there is no navigation taking place where I can pass on data from one vm to another.
Question:
Is MessagingCenter the best solution for this?
Sub question:
What is the best way to pass data between two view models for views showing at the same time (no navigation occurs)? I'm using MessagingCenter for this too right now.