Exemplo n.º 1
0
        private void Draw_Click(object sender, RoutedEventArgs e)
        {
            ResetUiVisibility();
            Canvas.IsEnabled        = true;
            CaptionInput.Visibility = Visibility.Collapsed;
            BasicToolbar.Visibility = Visibility.Collapsed;

            if (DrawToolbar == null)
            {
                FindName(nameof(DrawToolbar));
            }
            if (DrawSlider == null)
            {
                FindName(nameof(DrawSlider));
            }

            DrawToolbar.Visibility = Visibility.Visible;
            DrawSlider.Visibility  = Visibility.Visible;
            DrawSlider.SetDefault(SettingsService.Current.Pencil);

            Canvas.Mode            = PencilCanvasMode.Stroke;
            Canvas.Stroke          = DrawSlider.Stroke;
            Canvas.StrokeThickness = DrawSlider.StrokeThickness;

            Brush.IsChecked = true;
            Erase.IsChecked = false;
            InvalidateToolbar();
        }
Exemplo n.º 2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            ResetUI();

            Canvas.IsEnabled = true;
            if (DrawSlider == null)
            {
                FindName(nameof(DrawSlider));
            }

            DrawSlider.Visibility  = Visibility.Visible;
            Canvas.Mode            = CanvasMode.Stroke;
            Canvas.Stroke          = DrawSlider.Stroke;
            Canvas.StrokeThickness = DrawSlider.StrokeThickness;
            DrawSlider.SetDefault(new Vector2(1f, 0.22f));
            InvalidateToolbar();
        }