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

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

            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 SponsorsPage()
        {
            InitializeComponent();
            BindingContext = new SponsorsViewModel(Navigation);

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

            if (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.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;
            };
        }
        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;
            };
        }