public SponsorsPage()
        {
            InitializeComponent();
            BindingContext = new SponsorsViewModel(Navigation);

            if (Device.RuntimePlatform == Device.Android)
            {
                ListViewSponsors.Effects.Add(Effect.Resolve("Xamarin.ListViewSelectionOnTopEffect"));
            }

            if (Device.RuntimePlatform == Device.UWP || Device.RuntimePlatform == Device.WinPhone)
            {
                ToolbarItems.Add(new ToolbarItem
                {
                    Text    = "Refresh",
                    Icon    = "toolbar_refresh.png",
                    Command = ViewModel.ForceRefreshCommand
                });
            }
            ListViewSponsors.ItemSelected += async(sender, e) =>
            {
                var sponsor = ListViewSponsors.SelectedItem as Sponsor;
                if (sponsor == null)
                {
                    return;
                }
                var sponsorDetails = new SponsorDetailsPage();

                sponsorDetails.Sponsor = sponsor;
                App.Logger.TrackPage(AppPage.Sponsor.ToString(), sponsor.Name);
                await NavigationService.PushAsync(Navigation, sponsorDetails);

                ListViewSponsors.SelectedItem = null;
            };
        }
Beispiel #2
0
        public EventDetailsPage()
        {
            InitializeComponent();

            ListViewSponsors.ItemSelected += async(sender, e) =>
            {
                var sponsor = ListViewSponsors.SelectedItem as Sponsor;
                if (sponsor == null)
                {
                    return;
                }

                var sponsorDetails = new SponsorDetailsPage
                {
                    Sponsor = sponsor
                };

                App.Logger.TrackPage(AppPage.Sponsor.ToString(), sponsor.Name);
                await NavigationService.PushAsync(Navigation, sponsorDetails);

                ListViewSponsors.SelectedItem = null;
            };
        }