using PDF_Master.Model; using Prism.Commands; using Prism.Mvvm; using Prism.Regions; using System; using System.Collections.Generic; using System.Linq; namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter { public class HomePageConverterCSVViewModel : BindableBase, INavigationAware { #region 委托声明 public DelegateCommand RadioButtonCommand { get; set; } public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; } #endregion public HomePageConverterCSVViewModel() { RadioButtonCommand = new DelegateCommand(radiobutton); } #region 逻辑函数 private void radiobutton(string e) { string radioButton = e; if (radioButton != null) { switch (radioButton) { case "ForEachPageRadioBtn": homePageConverterDialogViewModel.ConverterCSVModel.Options.IsMergeCsv = false; break; case "OnlyTableRadioBtn": homePageConverterDialogViewModel.ConverterCSVModel.Options.IsMergeCsv = true; break; default: break; } } } #endregion #region 构架行为 public void OnNavigatedTo(NavigationContext navigationContext) { var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel; if (homePageConverterVM != null) { homePageConverterDialogViewModel = homePageConverterVM; homePageConverterDialogViewModel.ConverterCSVModel.Options.IsMergeCsv = false; } } public bool IsNavigationTarget(NavigationContext navigationContext) { return true; } public void OnNavigatedFrom(NavigationContext navigationContext) { } #endregion } }