Beispiel #1
0
 public void Sum()
 {
     if (_eventViewModels != null)
     {
         ProbabilitySumViewModel.ChangeSum(_eventViewModels.Select(ev => ev.Probability).ToList().Sum());
     }
 }
 /*   public EventWithParamListViewModel(ObservableCollection<Event> events, BaseLayer baseLayer)
 {
     Events = events;
     EventParams = baseLayer.DssDbContext.EventParams.Local;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventWithParamViewModels = new ObservableCollection<EventWithParamViewModel>();
     foreach (var ev in Events)
     {
         EventWithParamViewModels.Add(new EventWithParamViewModel(ev, ev.EventParams.ToList()[0], this));
     }
     Sum();
 }*/
 public EventWithParamListViewModel(BaseLayer baseLayer)
 {
     Events = baseLayer.DssDbContext.Events.Local;
     EventParams = baseLayer.DssDbContext.EventParams.Local;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventWithParamViewModels = new ObservableCollection<EventWithParamViewModel>();
     foreach (var ev in Events)
     {
         EventWithParamViewModels.Add(new EventWithParamViewModel(ev, ev.EventParams.ToList()[0], this));
     }
     Sum();
 }
Beispiel #3
0
        /*   public EventWithParamListViewModel(ObservableCollection<Event> events, BaseLayer baseLayer)
         * {
         *     Events = events;
         *     EventParams = baseLayer.DssDbContext.EventParams.Local;
         *     _baseLayer = baseLayer;
         *     ProbabilitySumViewModel = new ProbabilitySumViewModel();
         *     EventWithParamViewModels = new ObservableCollection<EventWithParamViewModel>();
         *     foreach (var ev in Events)
         *     {
         *         EventWithParamViewModels.Add(new EventWithParamViewModel(ev, ev.EventParams.ToList()[0], this));
         *     }
         *     Sum();
         * }*/

        public EventWithParamListViewModel(BaseLayer baseLayer)
        {
            Events                   = baseLayer.DssDbContext.Events.Local;
            EventParams              = baseLayer.DssDbContext.EventParams.Local;
            _baseLayer               = baseLayer;
            ProbabilitySumViewModel  = new ProbabilitySumViewModel();
            EventWithParamViewModels = new ObservableCollection <EventWithParamViewModel>();
            foreach (var ev in Events)
            {
                EventWithParamViewModels.Add(new EventWithParamViewModel(ev, ev.EventParams.ToList()[0], this));
            }
            Sum();
        }
 public EventListViewModel(BaseLayer baseLayer)
 {
     Events = baseLayer.DssDbContext.Events.Local;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventViewModels = new ObservableCollection<EventViewModel>();
     foreach (var ev in Events)
     {
         if(ev != null)
         EventViewModels.Add(new EventViewModel(ev, this));
     }
     Sum();
 }
 public EventListViewModel(ObservableCollection<Event> events, BaseLayer baseLayer)
 {
     Events = events;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventViewModels = new ObservableCollection<EventViewModel>();
     foreach (var ev in Events)
     {
         if (ev != null)
         EventViewModels.Add(new EventViewModel(ev, this));
     }
     Sum();
 }
Beispiel #6
0
 public EventListViewModel(BaseLayer baseLayer)
 {
     Events     = baseLayer.DssDbContext.Events.Local;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventViewModels         = new ObservableCollection <EventViewModel>();
     foreach (var ev in Events)
     {
         if (ev != null)
         {
             EventViewModels.Add(new EventViewModel(ev, this));
         }
     }
     Sum();
 }
Beispiel #7
0
 public EventListViewModel(ObservableCollection <Event> events, BaseLayer baseLayer)
 {
     Events     = events;
     _baseLayer = baseLayer;
     ProbabilitySumViewModel = new ProbabilitySumViewModel();
     EventViewModels         = new ObservableCollection <EventViewModel>();
     foreach (var ev in Events)
     {
         if (ev != null)
         {
             EventViewModels.Add(new EventViewModel(ev, this));
         }
     }
     Sum();
 }