123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace PDF_Office.Views.PropertyPanel.AnnotPanel
- {
- /// <summary>
- /// FreehandAnnotProperty.xaml 的交互逻辑
- /// </summary>
- public partial class FreehandAnnotProperty : UserControl
- {
- public FreehandAnnotProperty()
- {
- InitializeComponent();
- cusColor.SelectedColorHandler += cusColor_SelectedColor;
- layerThick.SelectedValueChanged += layerThick_SelectedValue;
- }
- private void layerThick_SelectedValue(object sender, double e)
- {
- var data = this.DataContext as FreehandAnnotPropertyViewModel;
- if (data != null)
- {
- data.SelectedValueChangedCommand?.Execute(e);
- }
- }
- private void cusColor_SelectedColor(object sender, Color e)
- {
- var data = this.DataContext as FreehandAnnotPropertyViewModel;
- if (data != null)
- {
- data.SelectedColorChangedCommand?.Execute(e);
- }
- }
- private void EraseBtn_Click(object sender, RoutedEventArgs e)
- {
- if (EraseBtn.IsChecked == true)
- {
- ErasePath.Visibility = Visibility.Visible;
- FreehandPath.Visibility = Visibility.Collapsed;
- PnlPen.Visibility = Visibility.Collapsed;
- PnlEraser.Visibility = Visibility.Visible;
- PenBtn.IsChecked = !EraseBtn.IsChecked;
- }
- else
- {
- EraseBtn.IsChecked = true;
- }
-
- }
- private void PenBtn_Click(object sender, RoutedEventArgs e)
- {
- if (PenBtn.IsChecked == true)
- {
- FreehandPath.Visibility = Visibility.Visible;
- ErasePath.Visibility = Visibility.Collapsed;
- PnlPen.Visibility = Visibility.Visible;
- PnlEraser.Visibility = Visibility.Collapsed;
- EraseBtn.IsChecked = !PenBtn.IsChecked;
- }
- else
- {
- PenBtn.IsChecked = true;
- }
- }
- }
- }
|