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;
            };
        }
예제 #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;
                };
        }
예제 #4
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
                };

                await NavigationService.PushAsync(Navigation, sponsorDetails);

                ListViewSponsors.SelectedItem = null;
            };
        }