예제 #1
0
        //InkinkToolsChanged
        private void InkToolbar_ActiveToolChanged(InkToolbar sender, object args)
        {
            if (BallPointPen_Button.IsChecked == true)
            {
                ViewModel.SelectedInkingToolIndex = 0;
                ViewModel.SelectedPen             = BallPointPen_Button;
            }
            else if (Pencil_Button.IsChecked == true)
            {
                ViewModel.SelectedInkingToolIndex = 1;
                ViewModel.SelectedPen             = Pencil_Button;
            }
            else if (Highlighter_Button.IsChecked == true)
            {
                ViewModel.SelectedInkingToolIndex = 2;
                ViewModel.SelectedPen             = Highlighter_Button;
            }
            else if (Laserpointer_Button.IsChecked == true)
            {
                ViewModel.SelectedInkingToolIndex = 3;
                ViewModel.ActivateLaserpointer(InkCanvas_GeometrySketch, Ellipse_Laserpointer, TranslateTransform_Ellipse_Laserpointer);
            }
            else if (Eraser_Button.IsChecked == true)
            {
                ViewModel.SelectedInkingToolIndex = 4;
                ViewModel.ActivateEraser(InkCanvas_GeometrySketch, Rectangle_Eraser, TranslateTransform_Rectangle_Eraser);
            }

            if (IsInkingToolAutoChanged != true)
            {
                LastInkingTool = ViewModel.SelectedInkingToolIndex;
            }

            GridView_Colors.DataContext = null;
            ViewModel.PenAttributesChanged(PreviewInkStrokeCanvas);
            GridView_Colors.DataContext = ViewModel.SelectedPen;
        }
예제 #2
0
 private void ListViewEraser_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ViewModel.ActivateEraser(InkCanvas_GeometrySketch, Rectangle_Eraser, TranslateTransform_Rectangle_Eraser);
 }