/// <summary>
        /// Select a color based on the postion of args.TouchDevice if hit.
        /// </summary>
        /// <param name="args">The arguments for the input event.</param>
        /// <param name="closeOnlyOnHit">Indicates if the ColorWheel should
        /// be kept open when an actual color is chosen.</param>
        /// <returns> true if a color was actually chosen.</returns>
        private bool ChooseColor(InputEventArgs args, bool closeOnlyOnHit)
        {
            // If the color wheel is not visible, bail out
            if (ColorWheel.Visibility == Visibility.Hidden)
            {
                return(false);
            }

            // Set the color on the CurrentColor indicator and on the SurfaceInkCanvas
            Color color = GetPixelColor(args.Device);

            // Black means the user touched the transparent part of the wheel. In that
            // case, leave the color set to its current value
            bool hit = color != Colors.Black;

            if (hit)
            {
                inkCanvas.DefaultDrawingAttributes.Color = color;
                CurrentEditingMode = SurfaceInkEditingMode.Ink;
            }

            args.Handled = true;
            return(hit);
        }
 private void brushSelectButton_Click(object sender, RoutedEventArgs e)
 {
     this.CurrentEditingMode = SurfaceInkEditingMode.Ink;
 }
 private void rubberSelectButton_Click(object sender, RoutedEventArgs e)
 {
     this.CurrentEditingMode = SurfaceInkEditingMode.EraseByPoint;
 }
 public void switchDrawMode(SurfaceInkEditingMode mode)
 {
     if (currentPathCanvas != null)
         currentPathCanvas.EditingMode = mode;
     if (currentHighlightCanvas != null)
         currentHighlightCanvas.EditingMode = mode;
 }