public ProgramsViewModel(IApplication app, IDataBase db) { _db = db; _application = app; Programs = new ObservableCollection <LauncherProgram>(); AddCommand = Command.CreateCommand(Add); EditCommand = Command.CreateCommand <string>(Edit); DeleteCommand = Command.CreateCommand <string>(Delete); RunCommand = Command.CreateCommand <string>(Run); RunSystemCommand = Command.CreateCommand <string>(RunSystem); Programs.AddRange(_db.Programs.GetAll()); StartMenu = new ObservableCollection <SystemProgram>(ProgramProviders.GetStartMenu()); }
private void ApplyStartMenuFilter() { if (string.IsNullOrEmpty(_startmenufilter)) { StartMenu.UpdateWith(ProgramProviders.GetStartMenu()); } else { var match = from program in ProgramProviders.GetStartMenu() where program.Name.Contains(_startmenufilter, StringComparison.InvariantCultureIgnoreCase) select program; StartMenu.UpdateWith(match); } }