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 }); } }
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 }); } }
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); } }