Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();
            applicationSession = ApplicationSession.Start(new DispatcherInvoker(Dispatcher));
            messageManager     = applicationSession.MessageManager;

            activeThoughtsPresenter = new CollectionsPresenter <SubjectSession, ObservableCollection <Message>, Message>(
                messageManager,
                manager => manager.ActiveThoughts,
                manager => manager.FocusedActiveThought);

            staleThoughtsPresenter = new CollectionsPresenter <SubjectSession, ObservableCollection <Message>, Message>(
                messageManager,
                manager => manager.StaleThoughts,
                manager => manager.FocusedStaleThought);

            mainWindowPresenter = new MainPresenter()
            {
                Entry = new ThoughtEntryPresenter(messageManager),
            };

            mainWindowPresenter.SetActiveDisplay(activeThoughtsPresenter);
            messageManager.PropertyChanged += messageManager_PropertyChanged;
            DataContext = mainWindowPresenter;
        }