HomePagePrinterDialog.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.Office.Interop.Excel;
  2. using PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter;
  3. using Prism.Ioc;
  4. using Prism.Regions;
  5. using System.Windows.Controls;
  6. using UserControl = System.Windows.Controls.UserControl;
  7. namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter
  8. {
  9. /// <summary>
  10. /// Interaction logic for PrinterDialog
  11. /// </summary>
  12. public partial class HomePagePrinterDialog : UserControl
  13. {
  14. private IContainerProvider containerProvider;
  15. public HomePagePrinterDialog(IContainerProvider containerProvider)
  16. {
  17. InitializeComponent();
  18. this.containerProvider = containerProvider;
  19. var regionManager = containerProvider.Resolve<IRegionManager>();
  20. RegionManager.SetRegionManager(this, regionManager);
  21. RegionManager.UpdateRegions();
  22. }
  23. private void PageRangeComboBox_Loaded(object sender, System.Windows.RoutedEventArgs e)
  24. {
  25. if (((HomePagePrinterDialogViewModel)this.DataContext).isCurrentPage)
  26. {
  27. PageRangeComboBox.CurrentPage = true;
  28. if (PageRangeComboBox.CurrentPage)
  29. {
  30. ComboBoxItem comboBoxItem = new ComboBoxItem();
  31. comboBoxItem.Content = "当前页面";
  32. PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
  33. }
  34. if (!string.IsNullOrEmpty( ((HomePagePrinterDialogViewModel)this.DataContext).PageListString))
  35. PageRangeComboBox.writableTextBox.Text = ((HomePagePrinterDialogViewModel)this.DataContext).PageListString;
  36. }
  37. }
  38. }
  39. }