public SessionDetailsPage(Session session, IDevice device) { InitializeComponent(); FavoriteButtonAndroid.Clicked += (sender, e) => { Device.BeginInvokeOnMainThread(() => FavoriteIconAndroid.Grow()); }; FavoriteButtoniOS.Clicked += (sender, e) => { Device.BeginInvokeOnMainThread(() => FavoriteIconiOS.Grow()); }; ListViewSpeakers.ItemSelected += async (sender, e) => { var speaker = ListViewSpeakers.SelectedItem as Speaker; if (speaker == null) return; var speakerDetails = new SpeakerDetailsPage(vm.Session.Id, device); speakerDetails.Speaker = speaker; App.Logger.TrackPage(AppPage.Speaker.ToString(), speaker.FullName); await NavigationService.PushAsync(Navigation, speakerDetails); ListViewSpeakers.SelectedItem = null; }; ButtonRate.Clicked += async (sender, e) => { var title = this.ViewModel?.Session?.Title; Xamarin.Insights.Track("Rate Session", "SessionTitle", title); if (DemoHelper.ShouldThrowException && (device.Name == "Nexus 5") && device.FirmwareVersion == "6.0.1" ) { try { throw new NotSupportedException(); } catch (Exception ex) { Xamarin.Insights.Report(ex, Insights.Severity.Critical); await Xamarin.Insights.PurgePendingCrashReports(); await Task.Delay(10000); throw; } //throw new NotSupportedException("Second exception"); } if (!Settings.Current.IsLoggedIn) { DependencyService.Get<ILogger>().TrackPage(AppPage.Login.ToString(), "Feedback"); MessagingService.Current.SendMessage(MessageKeys.NavigateLogin); return; } await NavigationService.PushModalAsync(Navigation, new EvolveNavigationPage(new FeedbackPage(ViewModel.Session))); }; BindingContext = new SessionDetailsViewModel(Navigation, session, device); ViewModel.LoadSessionCommand.Execute(null); }
protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); vm = null; ListViewSpeakers.HeightRequest = 0; }