public SnippetsViewModel() { _snippetRepository = new SnippetRepository(); _snippetService = new SnippetService(); Snippets = new ObservableCollection <Snippet>( _snippetRepository.GetAll()); _snippetService.ApplySnippets(Snippets); AddCommand = new DelegatingCommand(x => true, OnAdd); SaveCommand = new DelegatingCommand(x => true, OnSave); DeleteCommand = new DelegatingCommand(x => true, OnDelete); }
public void OnSave(object param) { // todo use Rx to debounce and auto-save _snippetRepository.Save(Snippets); _snippetService.ApplySnippets(Snippets); }