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; // Create Ink Canvas InkCanvas inkCanvas = new InkCanvas(0, 0, mainWindow.Width, mainWindow.Height); // Subscribe to event handler to get notified of gestures inkCanvas.Gesture += new InkCollectorGestureEventHandler(inkCanvas_Gesture); // Add the text control to the window. mainWindow.Child = inkCanvas; // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; 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; // Create Ink Canvas InkCanvas inkCanvas = new InkCanvas(0, 0, mainWindow.Width, mainWindow.Height); // Set line color to green DrawingAttributes attr = new DrawingAttributes(); attr.Color = Colors.Green; inkCanvas.DefaultDrawingAttributes = attr; // Add the text control to the window. mainWindow.Child = inkCanvas; // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; return mainWindow; }