public StartPageViewModel(IApplication application, IModuleLoader moduleLoader) { CategoryIndex = 0; _moduleLoader = moduleLoader; _application = application; Modules = new ObservableCollection <IModule>(); Modules.AddRange(_moduleLoader.GetModulesForCategory()); TileClickCommand = Command.CreateCommand <string>(TileClick); Categories = new Dictionary <string, int>(_moduleLoader.CategoryModuleCount); FilterCategoryCommand = Command.CreateCommand <KeyValuePair <string, int> >(FilterCategory); }
private void FilterCategory(KeyValuePair <string, int> obj) { SearchName = string.Empty; Modules.UpdateWith(_moduleLoader.GetModulesForCategory(obj.Key)); }