예제 #1
0
        public static void Main()
        {
            FirstWindow firstWindow = new FirstWindow();

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            Application myApplication = new Application();
            // Start the application
            myApplication.Run(firstWindow);
        }
예제 #2
0
        public void Initialize(object host)
        {
            _app = (Application)host;

            OneTimeConfig();

            _lcd = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
            Touch.Initialize(_app);

            _app.MainWindow = new Window();
            _app.MainWindow.TouchDown += MainWindow_TouchDown;
            _app.MainWindow.TouchUp += MainWindow_TouchUp;
            _app.MainWindow.TouchMove += MainWindow_TouchMove;
        }
예제 #3
0
        // Note: A constructor summary is auto-generated by the doc builder.
        /// <summary></summary>
        protected Program()
        {
            if (Mainboard == null) throw new Exception("Mainboard must be specified before a Program can be started.");
            if (Dispatcher != Dispatcher.CurrentDispatcher) throw new Exception("Program must be instantiated on main (Dispatcher) thread.");
            if (_instanceExists) throw new Exception("Cannot instantiate two Programs");

            try
            {
                _application = new Application();
            }
            catch 
            {
                Debug.Print("Error on boot - WPF may not work");
            }
            _instanceExists = true;
            _dispatcherBlockChecker = new Thread(DispatcherBlockChecker);
            _dispatcherBlockChecker.Start();
        }