123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using PDF_Office.CustomControl;
- using PDF_Office.ViewModels.Form;
- 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.Form
- {
- /// <summary>
- /// CheckBoxProperty.xaml 的交互逻辑
- /// </summary>
- public partial class CheckBoxProperty : UserControl
- {
- public CheckBoxPropertyViewModel ViewModel => DataContext as CheckBoxPropertyViewModel;
- public CheckBoxProperty()
- {
- InitializeComponent();
- this.Loaded += usercontrol_Loaded;
- BindingEvent();
- }
- private void usercontrol_Loaded(object sender, RoutedEventArgs e)
- {
- BindingEvent();
- }
- private void BindingEvent()
- {
- if (ViewModel != null)
- {
- ViewModel.SelectResetColorBtnHandler -= ViewModel_SelectResetColorBtnHandler;
- ViewModel.SelectResetColorBtnHandler += ViewModel_SelectResetColorBtnHandler;
- }
- }
- private void ViewModel_SelectResetColorBtnHandler(object sender, int e)
- {
- switch (e)
- {
- case 0:
- OneBtn.IsChecked = false;
- TwoBtn.IsChecked = false;
- ThreeBtn.IsChecked = false;
- ForthBtn.IsChecked = false;
- break;
- case 1:
- OneBtn.IsChecked = true;
- break;
- case 2:
- TwoBtn.IsChecked = true;
- break;
- case 3:
- ThreeBtn.IsChecked = true;
- break;
- case 4:
- ForthBtn.IsChecked = true;
- break;
- }
- }
- private void EditMenuItem_Click(object sender, RoutedEventArgs e)
- {
- var Btnitem = sender as MenuItem;
- if (Btnitem == null) return;
- if (ViewModel != null)
- {
- // ViewModel.ResetColorCommand?.Execute(Btnitem);
- }
- }
- private void BtnLineStyle_Click(object sender, RoutedEventArgs e)
- {
- var btn = sender as CustomIconToggleBtn;
- foreach (var item in PnlLineStyle.Children)
- {
- var btnItem = item as CustomIconToggleBtn;
- if (btnItem != null)
- {
- if (btn != btnItem)
- btnItem.IsChecked = false;
- else
- btnItem.IsChecked = true;
- }
- }
- }
- }
- }
|