public SpeakersPage() { this.InitializeComponent(); this.BindingContext = new SpeakersViewModel(this.Navigation); if (Device.RuntimePlatform == Device.Android) { this.ListViewSpeakers.Effects.Add(Effect.Resolve("Xpirit.ListViewSelectionOnTopEffect")); } this.ListViewSpeakers.ItemSelected += async(sender, e) => { if (!(this.ListViewSpeakers.SelectedItem is SpeakerModel speaker)) { return; } ContentPage destination; if (Device.RuntimePlatform == Device.UWP) { destination = new SpeakerDetailsPageUWP(speaker); } else { destination = new SpeakerDetailsPage(speaker); } await NavigationService.PushAsync(this.Navigation, destination); this.ListViewSpeakers.SelectedItem = null; }; }
public SpeakersPage() { this.InitializeComponent(); this.BindingContext = new SpeakersViewModel(this.Navigation); this.ListViewSpeakers.ItemSelected += async(sender, e) => { if (!(this.ListViewSpeakers.SelectedItem is SpeakerModel speaker)) { return; } ContentPage destination = new SpeakerDetailsPage(speaker); await NavigationService.PushAsync(this.Navigation, destination); this.ListViewSpeakers.SelectedItem = null; }; }