12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using PDF_Office.CustomControl;
- using PDF_Office.Helper;
- using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
- using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
- using PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- 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;
- using System.Xml.Linq;
- namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
- {
- /// <summary>
- /// MainPageSplitDialog.xaml 的交互逻辑
- /// </summary>
- public partial class HomePageSplitDialog : UserControl
- {
- public HomePageSplitDialog()
- {
- InitializeComponent();
- }
- private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- TextBox textBox = sender as TextBox;
- switch (textBox.Name.ToString())
- {
- case "FileNameLabelTextBox":
- {
- ((HomePageSplitDialogViewModel)this.DataContext).FileNameLabelText = FileNameLabelTextBox.Text;
- ((HomePageSplitDialogViewModel)this.DataContext).FileNameLabelChangeCommand.Execute();
- }
- break;
- case "FileNameDeimiterTextBox":
- {
- ((HomePageSplitDialogViewModel)this.DataContext).FileNameDeimiterText = FileNameDeimiterTextBox.Text;
- ((HomePageSplitDialogViewModel)this.DataContext).FileNameDeimiterChangeCommand.Execute();
- }
- break;
- default:
- break;
- }
- }
- private void PageTurningPreview_Loaded(object sender, RoutedEventArgs e)
- {
- SplitPreview.document = ((HomePageSplitDialogViewModel)this.DataContext).document;
- char[] enumerationSeparator = new char[] { ',' };
- char[] rangeSeparator = new char[] { '-' };
- if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, "1-" + SplitPreview.document.PageCount.ToString(), SplitPreview.document.PageCount, enumerationSeparator, rangeSeparator))
- { //TODO
- Trace.WriteLine("输入不对");
- MessageBoxEx.Show("输入不对");
- return;
- }
- SplitPreview.AwaitRenderBitmap(SplitPreview.document);
- SplitPreview.PageIndex.Text = SplitPreview.document.PageCount.ToString();
-
- }
- }
- }
|