Beispiel #1
0
        private AchievementTierDetailView CreateSelectedView()
        {
            var view = new AchievementTierDetailView()
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                EasingIn          = Easing.SpringOut,
                IsVisible         = false,
                YOffset           = App.ScreenHeight / 3f,
            };

            view.SetBinding(AchievementTierDetailView.ContentBindingContextProperty, nameof(ViewModel.Selected));
            view.SetBinding(BaseAnimatedView.AnimateProperty, nameof(ViewModel.ShowAchievementDetails));

            var swipeGesture = new SwipeGestureRecognizer
            {
                Direction = SwipeDirection.Right
            };

            swipeGesture.Swiped += (sender, args) =>
            {
                if (Toolbar.Instance.Stack.Count > 0)
                {
                    Toolbar.Instance.Pop();
                }
            };
            view.GestureRecognizers.Add(swipeGesture);

            return(view);
        }
Beispiel #2
0
        public AchievementsView()
        {
            this.SetBinding(ItemsSourceProperty, nameof(ViewModel.Achievements));

            _selectedView = CreateSelectedView();

            CreateView();
        }