Ejemplo n.º 1
0
        protected AppRunner(IDispatcher dispatcher, IUpdatablesService updatablesService, IApplicationStopwatch applicationStopwatch, IIoCFactory iocFactory)
        {
            this.dispatcher           = dispatcher;
            this.updatablesService    = updatablesService;
            this.applicationStopwatch = applicationStopwatch;

            Canvas = iocFactory.Create <ICanvas>();
        }
Ejemplo n.º 2
0
 public InputPanel(FrameworkElement element, IApplicationStopwatch applicationStopwatch)
 {
     element.MouseMove        += Element_MouseMove;
     element.MouseDown        += Element_MouseDown;
     element.MouseUp          += Element_MouseUp;
     element.MouseLeave       += Element_MouseLeave;
     element.MouseWheel       += Element_MouseWheel;
     this.element              = element;
     this.applicationStopwatch = applicationStopwatch;
 }
Ejemplo n.º 3
0
        public WpfAppRunner(SKElement skElement, IDispatcher dispatcher, IUpdatablesService updatablesService, IInputPanel inputPanel, IApplicationStopwatch applicationStopwatch, IIoCFactory iocFactory)
            : base(dispatcher, updatablesService, applicationStopwatch, iocFactory)
        {
            winDispatcher  = skElement.Dispatcher;
            this.skElement = skElement;

            skElement.PaintSurface += (o, args) =>
            {
                inputPanel.Scale = new Vector2((float)(args.Info.Width / skElement.ActualWidth),
                                               (float)(args.Info.Height / skElement.ActualHeight));

                OnRender(args.Surface.Canvas, new Size(args.Info.Width, args.Info.Height));
            };
        }