private void AddPageToList(List <KeyValuePair <string, SortedDictionary <string, string> > > objects) { PageScrollableContent page = new PageScrollableContent(objects.ToArray()); objects.Clear(); RowDefinition rowDefinition = new RowDefinition(); GridPagesIndicator.RowDefinitions.Add(rowDefinition); Border border = new Border { Background = new SolidColorBrush(Colors.LightGray), Margin = new Thickness(0, 2, 0, 2) }; Grid.SetRow(border, currentPageIndex); GridPagesIndicator.Children.Add(border); pages.Add(currentPageIndex, new KeyValuePair <PageScrollableContent, Border>(page, border)); currentPageIndex++; }
private void AddPageToList(List <string> objects) { PageScrollableContent page = new PageScrollableContent( objects.ToArray(), ControlsFactory.ElementType.Department, ButtonDepartment_Click, 4, objects.Count < 24 && currentPageIndex == 0); objects.Clear(); RowDefinition rowDefinition = new RowDefinition(); GridPagesIndicator.RowDefinitions.Add(rowDefinition); Border border = new Border { Background = new SolidColorBrush(Colors.LightGray), Margin = new Thickness(0, 2, 0, 2) }; Grid.SetRow(border, currentPageIndex); GridPagesIndicator.Children.Add(border); pages.Add(currentPageIndex, new KeyValuePair <PageScrollableContent, Border>(page, border)); currentPageIndex++; }
private void AddPageToList(List <string> objects, int maxElementsPerPage) { PageScrollableContent page; switch (source) { case PageSelectDepartment.Source.Price: List <ItemService> services = new List <ItemService>(); foreach (string item in objects) { string[] values = item.Split('@'); ItemService itemService = new ItemService(values[0], Convert.ToInt32(values[1]), string.Empty, string.Empty, string.Empty); services.Add(itemService); } page = new PageScrollableContent(services.ToArray(), maxElementsPerPage); break; case PageSelectDepartment.Source.DocInfo: return; case PageSelectDepartment.Source.Timetable: List <KeyValuePair <string, SortedDictionary <string, string> > > schedule = new List <KeyValuePair <string, SortedDictionary <string, string> > >(); foreach (string item in objects) { string[] values = item.Split('@'); schedule.Add(new KeyValuePair <string, SortedDictionary <string, string> >(values[0], Services.DataProvider.Schedule[values[1]][values[0]])); } page = new PageScrollableContent(schedule.ToArray(), maxElementsPerPage); break; case PageSelectDepartment.Source.DocRate: List <string> doctors = new List <string>(); foreach (string item in objects) { doctors.Add(item.Replace("@", Environment.NewLine + Environment.NewLine)); } doctors.Sort(); page = new PageScrollableContent( doctors.ToArray(), ControlsFactory.ElementType.Search, ButtonResult_Click, maxElementsPerPage, objects.Count < maxElementsPerPage && currentPageIndex == 0); break; default: return; } objects.Clear(); RowDefinition rowDefinition = new RowDefinition(); GridPagesIndicator.RowDefinitions.Add(rowDefinition); Border border = new Border { Background = new SolidColorBrush(Colors.LightGray), Margin = new Thickness(0, 2, 0, 2) }; Grid.SetRow(border, currentPageIndex); GridPagesIndicator.Children.Add(border); pages.Add(currentPageIndex, new KeyValuePair <PageScrollableContent, Border>(page, border)); currentPageIndex++; }