using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing; using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs; using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing; using Prism.Ioc; using Prism.Regions; using System.Windows.Controls; namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing { /// /// Interaction logic for HomePageBatchProcessingDialog /// public partial class HomePageBatchProcessingDialog : UserControl { private IContainerProvider containerProvider; public HomePageBatchProcessingDialog(IContainerProvider containerProvider) { InitializeComponent(); this.containerProvider = containerProvider; var regionManager = containerProvider.Resolve(); RegionManager.SetRegionManager(this, regionManager); RegionManager.UpdateRegions(); SetPathVisibility(HomePageBatchProcessingDialogModel.BatchProcessingIndex); } public void SetPathVisibility(int index) { this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; switch (index) { case 0: this.ShiftingPath.Visibility = System.Windows.Visibility.Visible; break; case 1: this.CompressPath.Visibility = System.Windows.Visibility.Visible; break; case 2: this.SecurityPath.Visibility = System.Windows.Visibility.Visible; break; case 3: this.WatermarkPath.Visibility = System.Windows.Visibility.Visible; break; case 4: this.BackgroundPath.Visibility = System.Windows.Visibility.Visible; break; case 5: this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible; break; case 6: this.BatesPath.Visibility = System.Windows.Visibility.Visible; break; case 7: this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible; break; } } private void Btn_Click(object sender, System.Windows.RoutedEventArgs e) { var btn = sender as Button; if (btn != null) { switch (btn.Name.ToString()) { case "BatesBtn": this.BatesBtn.IsEnabled = false; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Visible; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "SecurityBtn": this.BatesBtn.IsEnabled =true; this.SecurityBtn.IsEnabled = false; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Visible; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "ShiftingBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = false; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Visible; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "WatermarkBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = false; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Visible; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "HeaderFooterBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = false; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "BackgroundBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = false; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Visible; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "CompressBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = false; this.RemoveSecurityBtn.IsEnabled = true; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Visible; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden; break; case "RemoveSecurityBtn": this.BatesBtn.IsEnabled = true; this.SecurityBtn.IsEnabled = true; this.ShiftingBtn.IsEnabled = true; this.WatermarkBtn.IsEnabled = true; this.HeaderFooterBtn.IsEnabled = true; this.BackgroundBtn.IsEnabled = true; this.CompressBtn.IsEnabled = true; this.RemoveSecurityBtn.IsEnabled = false; this.BatesPath.Visibility = System.Windows.Visibility.Hidden; this.SecurityPath.Visibility = System.Windows.Visibility.Hidden; this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden; this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden; this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden; this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden; this.CompressPath.Visibility = System.Windows.Visibility.Hidden; this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible; break; } } } } }