Ejemplo n.º 1
0
        public SongGridViewModel(IRegionManager regionManager, IDialogService dialogService)
        {
            _regionManager = regionManager;
            _dialogService = dialogService;
            log            = (ServiceLocator.Current.GetInstance(typeof(ILogger)) as ILogger)?.GetLogger;
            log.Trace(">>>");
            _options = (ServiceLocator.Current.GetInstance(typeof(ISettingsManager)) as ISettingsManager)?.GetOptions;

            // Load the Settings
            _gridColumns = new SongGridViewColumns();
            CreateColumns();

            _songs = new BindingList <SongData>();
            ItemsSourceDataCommand            = new BaseCommand(SetItemsSource);
            SelectionChangedCommand           = new BaseCommand(SelectionChanged);
            ContextMenuCopyCommand            = new BaseCommand(ContextMenuCopy);
            ContextMenuCutCommand             = new BaseCommand(ContextMenuCut);
            ContextMenuPasteCommand           = new BaseCommand(ContextMenuPaste);
            ContextMenuDeleteCommand          = new BaseCommand(ContextMenuDelete);
            ContextMenuSelectAllCommand       = new BaseCommand(ContextMenuSelectAll);
            ContextMenuGoogleSearchCommand    = new BaseCommand(ContextMenuGoogleSearch);
            ContextMenuClearFilterCommand     = new BaseCommand(ContextMenuClearFilter);
            ContextMenuClearAllFiltersCommand = new BaseCommand(ContextMenuClearAllFilters);
            ContextMenuColumnChooserCommand   = new BaseCommand(ContextMenuColumnChooser);

            EventSystem.Subscribe <GenericEvent>(OnMessageReceived, ThreadOption.UIThread);
            BindingOperations.EnableCollectionSynchronization(Songs, _lock);
            log.Trace("<<<");
        }
Ejemplo n.º 2
0
        public SongGridViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
            log            = (ServiceLocator.Current.GetInstance(typeof(ILogger)) as ILogger).GetLogger;
            _options       = (ServiceLocator.Current.GetInstance(typeof(ISettingsManager)) as ISettingsManager).GetOptions;

            // Load the Settings
            _gridColumns = new SongGridViewColumns();
            CreateColumns();

            Songs = _options.Songlist;
            ItemsSourceDataCommand   = new BaseCommand(SetItemsSource);
            _selectionChangedCommand = new BaseCommand(SelectionChanged);

            EventSystem.Subscribe <GenericEvent>(OnMessageReceived, ThreadOption.UIThread);
        }