I'm pretty new to Xamarin and recently start trying to make an App using the Xamarin.Forms
XAML:
<Button Text="Quick Links" BackgroundColor="#99CCFF" Grid.Column = "2" Grid.ColumnSpan="2" TextColor="White" Clicked="OnQuickLinksButtonClicked" Command="{Binding Click}"/>
**Code Behind:
**
public partial class ProfileView : ContentPage
{
Patient globalPatient;
public ProfileView (Patient patient)
{
InitializeComponent ();
BindingContext = new ProfileViewModel (patient);
globalPatient = new Patient();
globalPatient = patient;
}
async void OnQuickLinksButtonClicked(object sender, EventArgs args)
{
await Navigation.PushAsync (new BarCodeView (globalPatient.Name));
}
}
My question is that how can I pass the patient object to the OnQuickLinksButtonClicked? I test the code above and the globalPatient.Name is empty.
Thanks!