Exemple #1
0
        public MemorizePage()
        {
            InitializeComponent();

            var panGes = new PanGestureRecognizer();

            panGes.PanUpdated += OnGrapPage;
            quizLayout.GestureRecognizers.Add(panGes);

            var tapGes = new TapGestureRecognizer();

            tapGes.Tapped += OnClickAnswer;

            chdess = quizLayout.Children.OfType <Label>().ToArray();
            var btns = quizLayout.Children.OfType <FrameEx>();

            foreach (var ele in btns)
            {
                ele.GestureRecognizers.Add(tapGes);
            }

            quest   = btns.ElementAt(0);
            choices = btns.Skip(1).ToArray();

            ChangeMode(true);
        }
        public MemorizePage()
        {
            InitializeComponent();

            var panGes = new PanGestureRecognizer();
            panGes.PanUpdated += OnGrapPage;
            quizLayout.GestureRecognizers.Add(panGes);

            var tapGes = new TapGestureRecognizer();
            tapGes.Tapped += OnClickAnswer;

            chdess = quizLayout.Children.OfType<Label>().ToArray();
            var btns = quizLayout.Children.OfType<FrameEx>();
            foreach (var ele in btns)
                ele.GestureRecognizers.Add(tapGes);

            quest = btns.ElementAt(0);
            choices = btns.Skip(1).ToArray();

            ChangeMode(true);
        }
Exemple #3
0
        public NavigationViewEx() : base()
        {
            if (DesignMode.DesignModeEnabled | DesignMode.DesignMode2Enabled)
            {
                return;
            }

            Content = _frame = new FrameEx();
            _frame.Focus(FocusState.Programmatic);

            ItemInvoked += (s, e) =>
            {
                if (e.IsSettingsInvoked)
                {
                    _frame.Navigate(SettingsPageType);
                }
                else
                {
                    var item = MenuItems.OfType <NavigationViewItemEx>().FirstOrDefault(x => x.Content.Equals(e.InvokedItem));
                    if (item != null)
                    {
                        SelectedItem = item;
                    }
                }
            };

            RegisterPropertyChangedCallback(DisplayModeProperty, (s, e) => UpdateHeaders());
            RegisterPropertyChangedCallback(IsPaneOpenProperty, (s, e) => UpdateHeaders());

            _frame.Navigated += (s, e) =>
            {
                var item = MenuItems
                           .OfType <NavigationViewItemEx>()
                           .Where(x => x.PageType.Equals(e.SourcePageType))
                           .Where(x => x.PageParameter == e.Parameter)
                           .FirstOrDefault();
                base.SelectedItem = (item == null && e.SourcePageType.Equals(SettingsPageType)) ? SettingsItem : item;
            };
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Frame> e)
        {
            base.OnElementChanged(e);

            FrameEx obj = Element as FrameEx;

            Layer.ShadowRadius  = obj.ShadowWidth;
            Layer.BorderWidth   = 1;
            Layer.ShadowOpacity = 0.8f;
            switch (obj.Border)
            {
            case Rect:
                Layer.CornerRadius = 0;
                break;

            case None:
                Layer.BorderWidth = 0;
                break;
            }
            if (obj.ShadowPos == ShadowPosition.LowerRight)
            {
                Layer.ShadowOffset = new CGSize(obj.ShadowWidth, obj.ShadowWidth);
            }
        }