I am making a mobile app using Xamarin. And using Prism to achieve MVVM with loose binding between Views and ViewModels. In one View, I am creating buttons programmatically from the code behind, like so:
var button = new Button {
Text = e.ToString(),
Command =
};
Container.Children.Add(button);
The buttons get created, but I have yet to find a way to bind the command property to a command on the ViewModel. I want to bind this loosely. According to MVVM the View cannot know anything about the ViewModel. Would things change a lot if I also wanted to parameterize the command? Is there a way to achieve this? Any help would be appreciated.