Пример #1
0
        //AnotherChildViewModel _anotherChildViewModel = (AnotherChildViewModel)IoC.GetInstance(typeof(AnotherChildViewModel), null);

        public HomeViewModel()
        {
            _thirdChild            = (ThirdChildViewModel)IoC.GetInstance(typeof(ThirdChildViewModel), null);
            _selectedPerson        = (PersonModel)IoC.GetInstance(typeof(PersonModel), null);
            _anotherChildViewModel = (AnotherChildViewModel)IoC.GetInstance(typeof(AnotherChildViewModel), null);
            _windowManager         = (IWindowManager)IoC.GetInstance(typeof(IWindowManager), null);

            //Adds new items to list people
            People.Add(new PersonModel {
                FirstName = "Will", LastName = "Smith"
            });
            People.Add(new PersonModel {
                FirstName = "Sue", LastName = "Johnes"
            });
            People.Add(new PersonModel {
                FirstName = "Robert", LastName = "Jackson"
            });

            _eventAggregator = (IEventAggregator)IoC.GetInstance(typeof(IEventAggregator), null);
            _eventAggregator.Subscribe(this);

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Task.Delay(1000).Wait();
                    Timer++;
                }
            });
        }
Пример #2
0
 public AnotherChildViewModel(IEventAggregator eventAggregator, PersonModel personModel, FirstChildViewModel firstChildViewModel, ThirdChildViewModel thirdChildViewModel)
 {
     _eventAggregator = eventAggregator;
     _eventAggregator.Subscribe(this);
     _person = personModel;
     _thirdChildViewModel = thirdChildViewModel;
 }