public SvgImagesViewModel() { _images = new ObservableCollectionSafe<ImageBaseViewModel>(); OpenFileCommand = new DelegateCommand(OpenFileExecute); OpenFolderCommand = new DelegateCommand(OpenFolderExecute); ExportDirCommand = new DelegateCommand(ExportDirExecute); InfoCommand = new DelegateCommand(InfoExecute); ContextMenuCommands = new ObservableCollection<Tuple<object, ICommand>>(); ContextMenuCommands.Add(new Tuple<object, ICommand>("Open Explorer", new DelegateCommand<string>(OpenExplorerExecute))); }
public SvgImagesViewModel() { _images = new ObservableCollectionSafe <ImageBaseViewModel>(); OpenFileCommand = new DelegateCommand(OpenFileExecute); OpenFolderCommand = new DelegateCommand(OpenFolderExecute); ExportDirCommand = new DelegateCommand(ExportDirExecute); InfoCommand = new DelegateCommand(InfoExecute); ContextMenuCommands = new ObservableCollection <Tuple <object, ICommand> >(); ContextMenuCommands.Add(new Tuple <object, ICommand>("Open Explorer", new DelegateCommand <string>(OpenExplorerExecute))); }
public void Initialize(IEnumerable <CellModel> cells, IEnumerable <DiscModel> discs, Action <CellModel> cellClickAction) { Cells = new ObservableCollectionSafe <CellViewModel>(); Discs = new ObservableCollectionSafe <DiscViewModel>(); _cellLookup = new Dictionary <CellModel, CellViewModel>(); _discLookup = new Dictionary <DiscModel, DiscViewModel>(); foreach (var cell in cells) { var vm = _cellViewModelFactory.Create(cell); Cells.Add(vm); _cellLookup.Add(cell, vm); } foreach (var disc in discs) { var vm = _discViewModelFactory.Create(disc); Discs.Add(vm); _discLookup.Add(disc, vm); } _cellClickAction = cellClickAction; }