public EvaluationManagementViewModel(IMeterViewModelFactory meterViewModelFactory, IMeterReadingViewModelFactory readingViewModelFactory, IMeterRepository meterRepository)
        {
            m_ReadingViewModelFactory = readingViewModelFactory;
            m_Repository = meterRepository;
            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);
            Reload();

            FlyoutActivated = true;
        }
 public SeriesViewModelFactory(IMeterRepository repository, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IMeterViewModelFactory meterViewModelFactory,
                               ITaskGenerator taskGenerator)
 {
     m_Repository = repository;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_MeterViewModelFactory = meterViewModelFactory;
     m_TaskGenerator         = taskGenerator;
     m_Random = new Random();
 }
Example #3
0
        public MeterManagementViewModel([Import] IMeterRepository contextRepository, [Import] IMapViewModelFactory mapViewModelFactory, [Import] IMeterViewModelFactory meterViewModelFactory)
        {
            m_Repository            = contextRepository;
            m_MapViewModelFactory   = mapViewModelFactory;
            m_MeterViewModelFactory = meterViewModelFactory;

            AddNewMap = new AddNewMapCommand(this);
            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);
            Reload();

            FlyoutActivated = true;
        }
 public SeriesAddViewModel(Series model, IMeterRepository repository, IMeterViewModelFactory meterViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                           ITaskGenerator taskGenerator)
 {
     DisplayName             = TranslationProvider.Translate("SeriesAdd");
     Model                   = model;
     m_Repository            = repository;
     m_MeterViewModelFactory = meterViewModelFactory;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_TaskGenerator = taskGenerator;
     CreateSelectableMeterViewModels(repository.Meter);
     CreateResponsibleSubjectViewModels(repository.ResponsibleSubjects);
 }
        public SeriesEditViewModel(Series model, IMeterRepository repository, IMeterViewModelFactory meterViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                                   ITaskGenerator taskGenerator, MeterReading selectedReading, IEnumerable <MeterReading> allMeterReadings)
            : base(model, repository, meterViewModelFactory, responsibleSubjectViewModelFactory, taskGenerator)
        {
            m_Repository      = repository;
            m_SelectedReading = selectedReading;
            m_MeterReadings   = allMeterReadings;

            DisplayName = TranslationProvider.Translate("SeriesEdit");
            SelectContainer();
            SelectWeekDays();
            SelectResponsibleSubject();
        }
Example #6
0
        public ReadingPlanningViewModel(ISeriesViewModelFactory seriesViewModelFactory, IMeterReadingViewModelFactory readingViewModelFactory, IMeterViewModelFactory meterViewModelFactory,
                                        IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IMeterRepository contextRepository, ITaskGenerator taskGenerator)
        {
            m_Repository                 = contextRepository;
            m_SeriesViewModelFactory     = seriesViewModelFactory;
            m_ReadingViewModelFactory    = readingViewModelFactory;
            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);
            Reload();

            LocalizeDictionary.Instance.PropertyChanged += delegate(object sender, PropertyChangedEventArgs args)
            {
                if (args.PropertyName == "Culture")
                {
                    if (m_Calendar != null)
                    {
                        m_Calendar.Refresh();
                    }
                }
            };

            FlyoutActivated = true;
        }
Example #7
0
 public MeterReadingViewModelFactory(IMeterViewModelFactory containerViewModelFactory, ISeriesViewModelFactory seriesViewModelFactory)
 {
     m_ContainerViewModelFactory = containerViewModelFactory;
     m_SeriesViewModelFactory    = seriesViewModelFactory;
 }