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

            CanvasView.PaintSurface += OnPaint;
            _touchHandler            = new TouchHandler();
            _touchHandler.RegisterEvents(CanvasView);
            _touchHandler.TouchAction      += OnTouch;
            CanvasView.PointerWheelChanged += OnPointerWheelChanged;
        }
Exemple #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _canvasView = MainView;

            _canvasView.PaintSurface += OnPaint;
            _touchHandler             = new TouchHandler();
            _touchHandler.RegisterEvents(_canvasView);
            _touchHandler.TouchAction += OnTouch;

            Foundation.NSNotificationCenter.DefaultCenter.AddObserver(
                new NSString("UIDeviceOrientationDidChangeNotification"), OnDeviceRotation);
        }
Exemple #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            _canvasView = FindViewById <SKCanvasView>(Resource.Id.canvasView);

            _canvasView.PaintSurface += OnPaint;
            _touchHandler             = new TouchHandler();
            _touchHandler.RegisterEvents(_canvasView);
            _touchHandler.TouchAction += OnTouch;
        }
        protected override void OnAttached()
        {
            _view = Control == null ? Container : Control;

            // Get access to the TouchEffect class in the PCL
            _touchEffect =
                (TouchTracking.Forms.TouchEffect)Element.Effects.FirstOrDefault(e => e is TouchTracking.Forms.TouchEffect);

            if (_touchEffect == null)
            {
                return;
            }

            _touchHandler              = new TouchHandler();
            _touchHandler.TouchAction += TouchHandlerOnTouch;
            _touchHandler.Capture      = _touchEffect.Capture;
            _touchHandler.RegisterEvents(_view);
        }