示例#1
0
        /*
         * Set up methods used in constructor above or when elements get loaded
         * */
        private void InitializeInkToolbar(FrameworkElement sender, object args)
        {
            inkToolbar.InitialControls = InkToolbarInitialControls.None;
            InkToolbarBallpointPenButton ballpoint = new InkToolbarBallpointPenButton();
            InkToolbarEraserButton       eraser    = new InkToolbarEraserButton();

            inkToolbar.Children.Add(eraser);
            inkToolbar.Children.Add(ballpoint);

            inkToolbar.Height = 75;

            toolbarGrid.ManipulationMode   = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
            toolbarGrid.ManipulationDelta += new ManipulationDeltaEventHandler(DragToolbar);
        }
示例#2
0
        private void InkToolbar_Loading(FrameworkElement sender, object args)
        {
            // Clear all built-in buttons from the InkToolbar.
            inkToolbar.InitialControls = InkToolbarInitialControls.None;

            InkToolbarEraserButton       eraser    = new InkToolbarEraserButton();
            InkToolbarBallpointPenButton ballpoint = new InkToolbarBallpointPenButton();
            InkToolbarPencilButton       pencil    = new InkToolbarPencilButton();
            InkToolbarStencilButton      ruler     = new InkToolbarStencilButton();

            inkToolbar.Children.Add(eraser);
            inkToolbar.Children.Add(ballpoint);
            inkToolbar.Children.Add(pencil);
            inkToolbar.Children.Add(ruler);
        }
示例#3
0
        // </SnippetInkToolbarLoadedCB>

        // <SnippetInkToolbarLoadingCB>
        /// <summary>
        /// Handles the Loading event of the InkToolbar.
        /// Here, we identify the buttons to include on the InkToolbar.
        /// </summary>
        /// <param name="sender">The InkToolbar</param>
        /// <param name="args">The InkToolbar event data.
        /// If there is no event data, this parameter is null</param>
        private void inkToolbar_Loading(FrameworkElement sender, object args)
        {
            // Clear all built-in buttons from the InkToolbar.
            inkToolbar.InitialControls = InkToolbarInitialControls.None;

            // Add only the ballpoint pen, pencil, and eraser.
            // Note that the buttons are added to the toolbar in the order
            // defined by the framework, not the order we specify here.
            InkToolbarBallpointPenButton ballpoint = new InkToolbarBallpointPenButton();
            InkToolbarPencilButton       pencil    = new InkToolbarPencilButton();
            InkToolbarEraserButton       eraser    = new InkToolbarEraserButton();

            inkToolbar.Children.Add(eraser);
            inkToolbar.Children.Add(ballpoint);
            inkToolbar.Children.Add(pencil);
        }