public SearchForQuestions(AccessToken accessToken) { InitializeComponent(); _accessToken = accessToken; ValidateAccessToken(); pageDetails = InitializePageDetails(); fullList = questionManager.GetQuestions(); questions = paginate.GetList(pageDetails, questionManager.GetQuestions()); gridQuestions.ItemsSource = questions; }
public ViewBlog(AccessToken accessToken) { this.accessToken = accessToken; InitializeComponent(); pageDetails = InitializePageDetails(); fullList = blogManager.GetBlogs(); blogs = paginate.GetList(pageDetails, blogManager.GetBlogs()); icBlogs.ItemsSource = ConvertBlogsToAnonymous(blogs); foreach (Role role in accessToken.Roles) { roles.Add(role.RoleID); } if (roles.Contains("Admin")) { btnCreateBlog.Visibility = System.Windows.Visibility.Visible; } }
private void SelectPlants() { try { dgrdNameSearch.ItemsSource = paginate.GetList(pageDetails, fullList); lblPage.Content = "Page " + pageDetails.CurrentPage; } catch (Exception) { dgrdNameSearch.ItemsSource = new List <Plant>(); } }
private void SelectTemplates() { try { icTemplates.ItemsSource = paginate.GetList(pageDetails, fullList); lblPage.Content = "Page " + pageDetails.CurrentPage; } catch (Exception) { icTemplates.ItemsSource = new List <GardenTemplate>(); } }
public ExpertAdviceRespond(AccessToken accessToken) { InitializeComponent(); List <Region> regions = regionManager.GetRegions(); _accessToken = accessToken; cmbRegions.Items.Add("All regions"); cmbRegions.Items.Add("No region"); foreach (Region region in regions) { cmbRegions.Items.Add(region); } cmbRegions.SelectedIndex = 0; blogs = blogManager.GetBlogs(); autoBlogs.ItemsSource = blogs; fullList = questionManager.GetQuestions(); pageDetails = InitializePageDetails(); gridQuestions.ItemsSource = paginate.GetList(pageDetails, fullList); }