public void Setup(SnowtamService snowtamService, string snowtamStatus) { if (snowtamService == null) throw new ArgumentNullException("snowtamService"); switch (snowtamStatus) { case "A": base.DisplayName = Entity.ArchiveSnowtamsViewModel_DisplayName; break; default: base.DisplayName = Entity.AllSnowtamsViewModel_DisplayName; break; } _snowtamService = snowtamService; // Subscribe for notifications of when a new customer is saved. _snowtamService.SnowtamAdded += this.OnSnowtamAddedToRepository; // Reload += this.OnReload; // Populate the AllCustomers collection with CustomerViewModels. this.CreateAllSnowtams(snowtamStatus); }
public SnowtamDetailViewModel(SnowtamDetail snowtam,SnowtamService snowtamService, SnowtamDetailService snowtamDetailService, ObservableCollection<WorkspaceViewModel> parent,WorkspaceViewModel ntmWorkspace) { parentWorkSpaces = parent; NotamWorkspace = ntmWorkspace; if (snowtam == null) throw new ArgumentNullException("notam"); if (snowtamService == null) throw new ArgumentNullException("snowtamService"); _snowtam = snowtam; _snowtamDetailService = snowtamDetailService; _snowtamService = snowtamService; this.validators = this.GetType() .GetProperties() .Where(p => this.GetValidations(p).Length != 0) .ToDictionary(p => p.Name, p => this.GetValidations(p)); this.propertyGetters = this.GetType() .GetProperties() .Where(p => this.GetValidations(p).Length != 0) .ToDictionary(p => p.Name, p => this.GetValueGetter(p)); }
// public event EventHandler<IList<Snowtam>> Reload; #region Constructor public AllSnowtamsViewModel(SnowtamService snowtamService, ObservableCollection<WorkspaceViewModel> parent, string snowtamStatus) { ParentWorkspaces = parent; Setup(snowtamService, snowtamStatus); }
public MainWindowViewModel(NotamDataContext dataContext ) { base.DisplayName = Entity.MainWindowViewModel_DisplayName; _originService = new OriginService(dataContext); _firService = new FIRService(dataContext); _notamService = new NotamService(dataContext); _aerodomService = new AerodomService(dataContext); _notamCodeService = new NotamCodeService(dataContext); _snowtamService = new SnowtamService(dataContext); _authService = new AuthenticationService(dataContext); _aftnService = new AftnService(dataContext); _intlNotamService = new IntlNotamService(dataContext); var workspace = new NotamSearchViewModel(_notamService, Workspaces); this.Workspaces.Add(workspace); this.SetActiveWorkspace(workspace); System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0,1,0); dispatcherTimer.Start(); }
public SnowtamViewModel(Snowtam snowtam, SnowtamService snowtamService) { if (snowtam == null) { throw new ArgumentNullException("snowtam"); } if (snowtamService == null) { throw new ArgumentNullException("snowtamService"); } this._snowtam = snowtam; this._snowtamService = snowtamService; }
public SnowtamViewModel(Snowtam snowtam, SnowtamService snowtamService, ObservableCollection<WorkspaceViewModel> parent) : this(snowtam, snowtamService) { this.parentWorkSpaces = parent; }