public void DisplayPrograms(Category category = Category.ALL) { List <Program> programs = ProgramDataService.FindAll(); currentPrograms.Clear(); DataSectionStack.Children.Clear(); if (category != Category.ALL) { foreach (var program in programs) { if (program.Category == category) { ProgramCell programCell = new ProgramCell(program, this); Grid viewProgramCell = programCell.BuildCell(); DataSectionStack.Children.Add(viewProgramCell); currentPrograms.Add(program); } } } else { foreach (var program in programs) { ProgramCell programCell = new ProgramCell(program, this); Grid viewProgramCell = programCell.BuildCell(); DataSectionStack.Children.Add(viewProgramCell); } currentPrograms = programs; } }
private void PrintCurrentPrograms() { DataSectionStack.Children.Clear(); foreach (var program in currentPrograms) { ProgramCell programCell = new ProgramCell(program, this); Grid viewProgramCell = programCell.BuildCell(); DataSectionStack.Children.Add(viewProgramCell); } }