public RecordsReportViewModel() { try { _logger.Info("Inside Records viewer view model construtor"); if (!ViewModelBase.IsInDesignModeStatic) { Alpharepo = new AlphaRepository(); Betarepo = new BetaRepository(); Gammarepo = new GammaRepository(); RecRepo = new RecordRepository(); StatusRepo = new StatusRepository(); DeltaRepo = new DeltaRepository(); ThetaRepo = new ThetaRepository(); SaveRecord = new RelayCommand(OnSave, canSave); SearchRecord = new RelayCommand(onSearch, canSearch); ExportToPDF = new RelayCommand(onExportToPdf, canExport); DeleteRecord = new RelayCommand(onDelete, canDelete); PdfFilterZeus = true; PdfFilterStatus = true; } } catch (Exception e) { _logger.Error("Some error have occured in RecordsReportViewModel, stacktrace=" + e.StackTrace); _logger.Error("RecordsReportViewModel error message is " + e.Message + " inner error is " + e.InnerException.Message); } }
//constructor public BetaListViewModel() { if (!ViewModelBase.IsInDesignModeStatic) { //Code that throws the exception repo = new BetaRepository(); AddBeta = new RelayCommand(OnAdd); DeleteBeta = new RelayCommand(OnDelete, CanDelete); SaveBeta = new RelayCommand(OnSave, CanSave); } }
public AddRecordViewModel() { try { if (!ViewModelBase.IsInDesignModeStatic) { _logger.Info("Inside Add Record ViewModel construtor"); Alpharepo = new AlphaRepository(); Betarepo = new BetaRepository(); Gammarepo = new GammaRepository(); DeltaRepo = new DeltaRepository(); ThetaRepo = new ThetaRepository(); AddRepo = new RecordRepository(); AddNewRecord = new RelayCommand(OnAdd, CanAdd); CancelRecord = new RelayCommand(OnCancel, CanCancel); } } catch (Exception e) { _logger.Error("Some error have occured in AddRecordViewModel" + e.StackTrace); _logger.Error("AddRecordViewModel error message is " + e.Message + " inner error is " + e.InnerException.Message); } }