Exemplo n.º 1
0
        public void SetUpFixture()
        {
            taskService = new Mock <ITaskRemoteService>();
            var eventAgregator = new Mock <IEventAggregator>();

            taskEditFinishedEvent = new Mock <TaskEditFinishedEvent>();
            taskEditFinishedEvent.Setup(
                x => x.Subscribe(It.IsAny <Action <object> >(), It.IsAny <ThreadOption>(), It.IsAny <bool>(), It.IsAny <Predicate <object> >()))
            .Returns(It.IsAny <SubscriptionToken>);

            eventAgregator.Setup(x => x.GetEvent <TaskEditFinishedEvent>()).Returns(taskEditFinishedEvent.Object);
            model = new TaskShowEditModel(taskService.Object, eventAgregator.Object);
        }
        public TaskShowEditView([Named("OutlookModel")]  TaskShowEditModel model)
        {
            InitializeComponent();

            this.DataContext = model;

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) =>
            {
                if (RegionContext.GetObservableContext(this).Value != null)
                {
                    model.Task = RegionContext.GetObservableContext(this).Value as OutlookTask;
                }
            };
        }