protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is Guid) { ViewModel = new AddYieldViewModel((Guid)e.Parameter); } }
protected override void OnAppearing() { base.OnAppearing(); BindingContext = new AddYieldViewModel(Navigation); if (Years.ItemsSource != null) { Years.SelectedIndex = Years.ItemsSource.Count - 1; } Plants.SelectedIndex = 0; Years.SelectedIndex = 0; }