Exemplo n.º 1
0
        async protected override void Initialize()
        {
            InitializeComponent();
            Title = "Athletes";

            list.ItemSelected += async(sender, e) =>
            {
                if (list.SelectedItem == null)
                {
                    return;
                }

                var athlete = list.SelectedItem as Athlete;
                list.SelectedItem = null;

                var detailsPage = new AthleteProfilePage(athlete.Id);
                detailsPage.OnSave = () =>
                {
                    ViewModel.LocalRefresh();
                    detailsPage.OnSave = null;
                };

                await Navigation.PushAsync(detailsPage);
            };

            using (new HUD("Getting all athletes..."))
            {
                await ViewModel.GetAllAthletes();
            }
        }
Exemplo n.º 2
0
        async void OnProfileSelected()
        {
            var page = new AthleteProfilePage(App.CurrentAthlete.Id);

            page.OnSave = async() => await Navigation.PopModalAsync();

            await Navigation.PushModalAsync(page.GetNavigationPage());
        }
        async void OnProfileSelected()
        {
            if (App.CurrentAthlete == null || App.CurrentAthlete.Id == null)
            {
                return;
            }

            var page = new AthleteProfilePage(App.CurrentAthlete.Id);

            page.OnSave = async() => await Navigation.PopModalAsync();

            await Navigation.PushModalAsync(page.WithinNavigationPage());
        }