Esempio n. 1
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;
        }
        public ReadingPlanningViewModel([Import] ISeriesViewModelFactory seriesViewModelFactory, [Import] IFillLevelReadingViewModelFactory readingViewModelFactory,
                                        [Import] IWasteRepository contextRepository)
        {
            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;
        }