public SessionDetailsPage(Session session)
        {
            InitializeComponent();

            _extension = DependencyService.Get <IPlatformSpecificExtension <Session> >();

            ItemId = session?.Title;

            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;
                }

                ContentPage destination;

                if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone)
                {
                    var speakerDetailsUwp = new SpeakerDetailsPageUWP(vm.Session.Id);
                    speakerDetailsUwp.Speaker = speaker;
                    destination = speakerDetailsUwp;
                }
                else
                {
                    var speakerDetails = new SpeakerDetailsPage(vm.Session.Id);
                    speakerDetails.Speaker = speaker;
                    destination            = speakerDetails;
                }

                await NavigationService.PushAsync(Navigation, destination);

                ListViewSpeakers.SelectedItem = null;
            };


            ButtonRate.Clicked += async(sender, e) =>
            {
                if (!Settings.Current.IsLoggedIn)
                {
                    MessagingService.Current.SendMessage(MessageKeys.NavigateLogin);
                    return;
                }
                await NavigationService.PushModalAsync(Navigation, new EvolveNavigationPage(new FeedbackPage(ViewModel.Session)));
            };
            BindingContext = new SessionDetailsViewModel(Navigation, session);
            ViewModel.LoadSessionCommand.Execute(null);
        }
        public SessionDetailsPage(Session session)
        {
            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);

                speakerDetails.Speaker = speaker;
                App.Logger.TrackPage(AppPage.Speaker.ToString(), speaker.FullName);
                await NavigationService.PushAsync(Navigation, speakerDetails);

                ListViewSpeakers.SelectedItem = null;
            };


            ButtonRate.Clicked += async(sender, e) =>
            {
                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()
                                                                                            .WithSession(ViewModel.Session)));
            };
            BindingContext = new SessionDetailsViewModel(Navigation, session);
            ViewModel.LoadSessionCommand.Execute(null);
        }
Example #3
0
        public SessionDetailsPage(Session session)
        {
            InitializeComponent();
            CarouselMaps.ItemsSource = new List <EvolveMap>
            {
                new EvolveMap
                {
                    //   Local = "floor_1.png",
                    Url = session.Title
                          // Title = "Floor Maps (1/2)"
                },
                new EvolveMap
                {
                    // Local = "floor_2.png",
                    Url = "https://s3.amazonaws.com/xamarin-releases/evolve-2016/floor_2.png",
                    // Title = "Floor Maps (2/2)"
                }
            };


            if (Device.OS == TargetPlatform.Android || Device.OS == TargetPlatform.iOS)
            {
                Title = "Floor Maps (1/2)";
                CarouselMaps.ItemSelected += (sender, args) =>
                {
                    var current = args.SelectedItem as EvolveMap;
                    if (current == null)
                    {
                        return;
                    }
                    Title = current.Title;
                };
            }

            try
            {
                FavoriteButtonAndroid.Clicked += (sender, e) =>
                {
                    Device.BeginInvokeOnMainThread(() => FavoriteIconAndroid.Grow());
                };
                FavoriteButtoniOS.Clicked += (sender, e) =>
                {
                    Device.BeginInvokeOnMainThread(() => FavoriteIconiOS.Grow());
                };
            }
            catch
            {
            }

            //ListViewSpeakers.ItemSelected += async (sender, e) =>
            //    {
            //        var speaker = ListViewSpeakers.SelectedItem as Speaker;
            //        if(speaker == null)
            //            return;

            //        var speakerDetails = new SpeakerDetailsPage(vm.Session.Id);

            //        speakerDetails.Speaker = speaker;
            //        App.Logger.TrackPage(AppPage.Speaker.ToString(), speaker.FullName);
            //        await NavigationService.PushAsync(Navigation, speakerDetails);
            //        ListViewSpeakers.SelectedItem = null;
            //    };


            ButtonRate.Clicked += async(sender, e) =>
            {
                //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);
            ViewModel.LoadSessionCommand.Execute(null);
        }