void AddToolBarItems() { ToolbarItems.Add (new ToolbarItem ("DisplayView", ImageConstants.tiledIcon, () => { ViewModel.IsRunning = true; if (CurrentLayout == LayoutType.ListLayout) { CurrentLayout = LayoutType.TiledLayout; ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.listIcon; SwitchLayouts (CurrentLayout); } else { CurrentLayout = LayoutType.ListLayout; ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.tiledIcon; SwitchLayouts (CurrentLayout); } ViewModel.IsRunning = false; })); ToolbarItems.Add ( new ToolbarItem ("LanguageFilter", ImageConstants.languageIcon, async () => { var content = new NavigationPage (new DocumentsFilters (FilterTypes.Languages)); content.BarBackgroundColor = Color.Transparent; content.BarTextColor = Color.White; await Navigation.PushModalAsync (content, true); })); ToolbarItems.Add (new ToolbarItem ("CategoryFilter", ImageConstants.filterIcon, async () => { var content = new NavigationPage (new DocumentsFilters (FilterTypes.Categories)); content.BarBackgroundColor = Color.Transparent; content.BarTextColor = Color.White; await Navigation.PushModalAsync (content, true); }) ); ToolbarItems.Add (new ToolbarItem ("SearchFilter", ImageConstants.searchIcon, async () => { var content = new SearchView (LibraryType.MyDocuments); await Navigation.PushAsync (content, true); }) ); }
void AddToolBarItems () { ToolbarItems.Add (new ToolbarItem ("DisplayView", ImageConstants.tiledIcon, () => { breadcrumbcategory.Text = GlobalVariables.SelectedCategory; ViewModel.IsRunning = true; if (CurrentLayout == LayoutType.ListLayout) { CurrentLayout = LayoutType.TiledLayout; ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.listIcon; SwitchLayouts (CurrentLayout); } else { CurrentLayout = LayoutType.ListLayout; ToolbarItems.FirstOrDefault (i => i.Text == "DisplayView").Icon = ImageConstants.tiledIcon; SwitchLayouts (CurrentLayout); } ViewModel.IsRunning = false; })); ToolbarItems.Add ( new ToolbarItem ("LanguageFilter", ImageConstants.languageIcon, async () => { var content = new NavigationPage (new ToolBarFilters (FilterTypes.Languages)); content.BarBackgroundColor = Color.Transparent; content.BarTextColor = Color.White; await Navigation.PushModalAsync (content, true); })); ToolbarItems.Add (new ToolbarItem ("Refresh", "corningimages/refresh.png", () => { LoadDataAsync (); })); ToolbarItems.Add (new ToolbarItem ("CategoryFilter", ImageConstants.filterIcon, async () => { var content = new NavigationPage (new ToolBarFilters (FilterTypes.Categories)); content.BarBackgroundColor = Color.Transparent; content.BarTextColor = Color.White; await Navigation.PushModalAsync (content, true); }) ); ToolbarItems.Add (new ToolbarItem ("SearchFilter", ImageConstants.searchIcon, async () => { var content = new SearchView (LibraryType.All); await Navigation.PushAsync (content, true); }) ); }