public MergedDataSourceViewModel(IMergedDataSource dataSource, IActionCenter actionCenter, IApplicationSettings applicationSettings) : base(dataSource, actionCenter, applicationSettings) { if (actionCenter == null) { throw new ArgumentNullException(nameof(actionCenter)); } _actionCenter = actionCenter; _dataSource = dataSource; _observable = new ObservableCollection <IDataSourceViewModel>(); AddFileMenuItems(new [] { new CommandMenuViewModel(new DelegateCommand2(OpenInExplorer)) { Header = "Open Containing Folder(s)", ToolTip = "Opens the Folder(s) of the Child Data sources" } }); AddViewMenuItems(new[] { new ToggleMenuViewModel(DisplayMode == DataSourceDisplayMode.Filename, OnToggleShowFileNames) { Header = "Show source name", ToolTip = "Toggles between showing the full name of the data source or a character code representing the original data source" } }); SetContextMenuItems(new IMenuViewModel[] { new IncludeAllInGroupViewModel(this), new ExcludeAllInGroupViewModel(this) }); Update(); }
public MergedDataSourceViewModel(MergedDataSource dataSource, IActionCenter actionCenter) : base(dataSource) { if (actionCenter == null) { throw new ArgumentNullException(nameof(actionCenter)); } _actionCenter = actionCenter; _dataSource = dataSource; _observable = new ObservableCollection <IDataSourceViewModel>(); _openInExplorerCommand = new DelegateCommand(OpenInExplorer); Update(); }
private MergedDataSourceViewModel CreateMergedViewModel(IMergedDataSource dataSource) { return(new MergedDataSourceViewModel(dataSource, _actionCenter.Object, _applicationSettings.Object)); }