Example #1
0
        public DataGridRenderer() : base()
        {
            var gr_pan = new pan_gr(this);

            gr_pan.MaximumNumberOfTouches = 1;
            // TODO or maybe two fingers should be scroll but one finger is select?
            this.AddGestureRecognizer(gr_pan);

            var gr_singletap_datacells = new UITapGestureRecognizer(on_singletap);

            gr_singletap_datacells.NumberOfTapsRequired = 1;

                        #if not // TODO worth noting that we don't have double tap or long press
            var gr_doubletap_datacells = new UITapGestureRecognizer(on_doubletap);
            gr_doubletap_datacells.NumberOfTapsRequired = 2;

            gr_singletap_datacells.RequireGestureRecognizerToFail(gr_doubletap_datacells);

            var gr_longpress_datacells = new UILongPressGestureRecognizer(on_longpress);

            this.AddGestureRecognizer(gr_longpress_datacells);
            this.AddGestureRecognizer(gr_doubletap_datacells);
                        #endif

            this.AddGestureRecognizer(gr_singletap_datacells);
        }
Example #2
0
        public ScrollableDataPanelView(IScrollablePanel <TGraphics> dp, Func <DataPanelView <TGraphics>, TGraphics> func_gr) : base(dp, func_gr)
        {
            var gr_pan = new pan_gr(this);

            gr_pan.MaximumNumberOfTouches = 1;
            // TODO or maybe two fingers should be scroll but one finger is select?
            this.AddGestureRecognizer(gr_pan);
        }
Example #3
0
            private static void on_fire(UIPanGestureRecognizer gr)
            {
                pan_gr me = gr as pan_gr;

                if (gr.State == UIGestureRecognizerState.Began)
                {
                    me._dg._mine.GetContentOffset(out me._began_x, out me._began_y);
                }
                else if (gr.State == UIGestureRecognizerState.Changed)
                {
                    var pt = gr.TranslationInView(me._dg);

                    double x = me._began_x - pt.X;
                    double y = me._began_y - pt.Y;

                    me._dg._mine.SetContentOffset(x, y);
                }
            }