Hi, I'm playing around with some code, trying to achieve the same thing with what I have already done with xaml, but now without it. So first of all I have simply created two .cs files one customersViewP.cs and the other customersViewP.gui.cs. These are partial classes implementing the ContentPage class. The gui file has only the InitializeComponent function implemented where all gui code takes place. The customersViewP.cs should be a complete copy of the code-behind file customersView.xaml.cs.
That being said I have a customersViewModel.cs which both of these implementations (xaml and not xaml) should use, and it is here I have encountered into binding issues for the non-xaml implementation. I am asking as I have found poor and little examples for this.
The code-behind (customersView.xaml.cs) and customersViewP.cs have the following constructor:
Lets being with the viewModel (CustomersViewModel):
These are the properties I have bound in the xaml version like this
So how do I bind these with code? I have managed to use the event handler instead of the command property,
but out of curiosity, how does one bind a command in code to get this to work?
I have also a dataTemplate that looks like this in xaml (dxGrid is part of devexpress gridcontrol)
and like this in code, which I havn't got to test as I have not managed to get the binding to work.