Exemple #1
0
        public const int AutoRefreshInterval = 15000; //TODO: Wire to configuration/settings

        public ShellViewModel(
            IScreenFactory screenFactory,
            IWindowManagerEx windowManager,
            IExplorerViewModel explorer,
            IMessageListViewModel messages,
            IStatusBarManager statusBarManager,
            IEventAggregator eventAggregator,
            IConversationViewModel conversation,
            IMessageBodyViewModel messageBodyViewer,
            IEnumerable <IHeaderInfoViewModel> headers)
        {
            _screenFactory   = screenFactory;
            _windowManager   = windowManager;
            _eventAggregator = eventAggregator;
            Headers          = headers;
            Conversation     = conversation;
            StatusBarManager = statusBarManager;
            Explorer         = explorer;
            MessageBody      = messageBodyViewer;
            Messages         = messages;

            Items.Add(messageBodyViewer);
            Items.Add(conversation);
            Items.Add(explorer);
            Items.Add(messages);

            InitializeAutoRefreshTimer();
        }
Exemple #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var    convID    = (long)e.Parameter;
            string uniqueKey = CoreHelper.GetConversationUniqueViewModelKey(convID);

            vm = ServiceLocator.Current.GetInstance <KeyedViewModelLocator>()
                 .GetByKey <IConversationViewModel>(uniqueKey, () =>
            {
                if (convID < 0)
                {
                    return(new ChatViewModel((uint)-convID));
                }
                else
                {
                    return(new DialogViewModel((ulong)convID));
                }
            });
            DataContext = vm;
            ((BaseViewModel)vm).Activate();

            CoreHelper.UnlockOrientation();
        }