public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.Background = new SolidColorBrush(Color.White); imageView = new Image(); imageView.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center; imageView.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Center; mainWindow.Child = imageView; mainWindow.AddHandler(Buttons.ButtonDownEvent, new ButtonEventHandler(OnButtonDown), false); mainWindow.Visibility = Visibility.Visible; Buttons.Focus(mainWindow); // Create camera camera = new C328R(new SerialPort("COM2", 115200)); InitCamera(); return mainWindow; }
public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.Background = new SolidColorBrush(Color.White); imageView = new Image(); imageView.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center; imageView.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Center; mainWindow.Child = imageView; mainWindow.AddHandler(Buttons.ButtonDownEvent, new ButtonEventHandler(OnButtonDown), false); mainWindow.Visibility = Visibility.Visible; Buttons.Focus(mainWindow); // Create camera camera = new C328R(new SerialPort("COM2", 115200)); InitCamera(); return(mainWindow); }