Example #1
0
        private GlobalStatisticsViewModel ReadArchiveData(string path)
        {
            GlobalStatisticsViewModel globalStats = new GlobalStatisticsViewModel(path);

            Chats = new List <ChatViewModel>();
            foreach (ChatModel chat in globalStats.Statistics.Chats)
            {
                Chats.Add(new ChatViewModel(chat));
            }

            return(globalStats);
        }
Example #2
0
        /// <summary>
        /// Called when a file is dropped on the main display area
        /// </summary>
        /// <param name="e">Drag event arguments</param>
        public async Task FileDropped(DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string path = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
                ActivateItem(new LoadingViewModel());
                GlobalStatisticsViewModel globalStats = await Task.Run(() => ReadArchiveData(path));

                NotifyOfPropertyChange(() => Chats);
                ActivateItem(globalStats);
            }
        }