Beispiel #1
0
        protected override void Initialize()
        {
            InitializeComponent();
            Title = ViewModel?.League?.Name;

            rankStrip.Membership = ViewModel?.CurrentMembership;             //Binding is not working in XAML for some reason

            scrollView.Scrolled += (sender, e) => Parallax();
            Parallax();

            btnRefresh.Clicked += async(sender, e) =>
            {
                using (new HUD("Refreshing..."))
                {
                    await ViewModel.RefreshLeague(true);

                    rankStrip.Membership = ViewModel.CurrentMembership;
                    UpdateChallenageCarousel();
                }
            };

            rankStrip.OnAthleteClicked = async(membership) =>
            {
                var page = new MembershipDetailsPage(membership);
                await Navigation.PushAsync(page);
            };

            if (ViewModel?.CurrentMembership != null && ViewModel?.CurrentMembership?.CurrentRank == 0)
            {
                HeapGloriousPraise();
            }
        }
Beispiel #2
0
        async protected override void Initialize()
        {
            InitializeComponent();
            Title = "Leaderboard";

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

                var vm = list.SelectedItem as MembershipViewModel;
                list.SelectedItem = null;
                var page = new MembershipDetailsPage(vm.Membership);

                await Navigation.PushAsync(page);
            };

            SubscribeToChallenges();

            if (ViewModel?.League != null)
            {
                await ViewModel.LocalRefresh();
            }
        }