コード例 #1
0
 private void UIPaths_CurrentChanged(object sender, EventArgs e)
 {
     if (!eventAggregator.IsNull())
     {
         eventAggregator.GetEvent <ContentSelectionEvents>().Publish(new ContentSelectionEventArgs()
         {
             SelectionType = SelectionType.Library, LibraryItemEntity = UIPaths.CurrentItem as LibraryItemEntity
         });
     }
 }
コード例 #2
0
        private void PublishSelectedEvent()
        {
            IEventAggregator eventAggregator = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <IEventAggregator>();

            if (!eventAggregator.IsNull())
            {
                eventAggregator.GetEvent <ContentSelectionEvents>().Publish(new ContentSelectionEventArgs()
                {
                    SelectionType = SelectionType.Category, UICategoryEntity = this
                });
            }
        }
コード例 #3
0
        public void RefreshDBData()
        {
            libraryItems.Clear();
            foreach (LibraryItemEntity libraryItem in DBHelper.GetLibraryItems())
            {
                libraryItems.Add(libraryItem);
            }

            histories.Clear();
            foreach (HistoryEntity history in DBHelper.GetHistories())
            {
                histories.Add(history);
            }

            categories.Clear();
            foreach (CategoryEntity category in DBHelper.GetCategories())
            {
                categories.Add(category);
            }

            try
            {
                IEventAggregator eventAggregator = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <IEventAggregator>();
                if (!eventAggregator.IsNull())
                {
                    eventAggregator.GetEvent <DBDataRefreshedEvents>().Publish(new DBDataRefreshedEventEventArgs()
                    {
                        DBDataType = DBDataType.All
                    });
                }
            }
            catch (Exception e)
            {
                NLogger.LogHelper.UILogger.Debug(e);
            }
        }