private void InitializeWidget(LayoutOrientation orientation) { tap_gd = new TapGestureDetector(); dtap_gd = new DoubleTapGestureDetector(); drag_gd = new DragGestureDetector(); longPress_gd = new LongPressGestureDetector(); FPS_Label = new Label(); FPS_Label.Name = "FPS Label"; // FPS_Label FPS_Label.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f); FPS_Label.Font = new UIFont(FontAlias.System, 25, FontStyle.Regular); FPS_Label.LineBreak = LineBreak.Character; tap_gd.TapDetected += Tap; dtap_gd.DoubleTapDetected += DoubleTap; drag_gd.DragDetected += Drag; drag_gd.DragStartDetected += dragStart; drag_gd.DragEndDetected += dragEnd; longPress_gd.LongPressDetected += LongPress; lblOutput = new Label(); imgDesktop = new ImageBox(); imgDesktop2 = new ImageBox(); dummy = new ImageBox(); dummy.AddGestureDetector(tap_gd); dummy.AddGestureDetector(dtap_gd); dummy.AddGestureDetector(drag_gd); dummy.AddGestureDetector(longPress_gd); imgDesktop.ImageScaleType = ImageScaleType.Stretch; this.RootWidget.AddChildLast(imgDesktop); this.RootWidget.AddChildLast(imgDesktop2); this.RootWidget.AddChildLast(dummy); this.RootWidget.AddChildLast(lblOutput); this.RootWidget.AddChildLast(FPS_Label); SetWidgetLayout(orientation); }
private void InitializeWidget(LayoutOrientation orientation) { tap_gd = new TapGestureDetector(); dtap_gd = new DoubleTapGestureDetector(); drag_gd = new DragGestureDetector(); longPress_gd = new LongPressGestureDetector(); tap_gd.TapDetected += Tap; dtap_gd.DoubleTapDetected += DoubleTap; drag_gd.DragDetected += Drag; drag_gd.DragStartDetected += dragStart; drag_gd.DragEndDetected += dragEnd; longPress_gd.LongPressDetected += LongPress; lblOutput = new Label(); imgDesktop = new ImageBox(); imgDesktop2 = new ImageBox(); dummy = new ImageBox(); //imgDesktop.AddGestureDetector(tap_gd); //imgDesktop.AddGestureDetector(dtap_gd); //imgDesktop.AddGestureDetector(drag_gd); dummy.AddGestureDetector(tap_gd); dummy.AddGestureDetector(dtap_gd); dummy.AddGestureDetector(drag_gd); dummy.AddGestureDetector(longPress_gd); imgDesktop.ImageScaleType = ImageScaleType.Stretch; this.RootWidget.AddChildLast(imgDesktop); this.RootWidget.AddChildLast(imgDesktop2); this.RootWidget.AddChildLast(dummy); this.RootWidget.AddChildLast(lblOutput); SetWidgetLayout(orientation); }