public SearchContentPage() { this.Title = "Search Page"; var lstPeople = new CoreListView() { ItemTemplate = new DataTemplate(typeof(PeopleCell)) }; lstPeople.SetBinding(CoreListView.ItemsSourceProperty, "People"); if (Device.RuntimePlatform == "iOS") { searchBar = new SearchBar() { SearchCommand = new Command((obj) => { VM.SearchCommand.Execute(searchBar.Text); }) }; Content = new StackContainer(true) { Children = { searchBar, lstPeople } }; } else { Content = new StackContainer(true) { Children = { lstPeople } }; } }
public AnalyticsPage() { this.Title = "App Analytics"; var lst = new CoreListView() { ItemTemplate = new DataTemplate(typeof(AnalyticsPageCell)) }; lst.SetBinding(CoreListView.ItemsSourceProperty, "AnalyticLogs"); var btnClear = new CoreButton() { Text = "Clear", Style = CoreStyles.LightOrange, AutomationId = "btnClear" }; btnClear.SetBinding(CoreButton.CommandProperty, "ClearAnalyticEntries"); Content = new CompressedStackLayout() { Padding = 20, Spacing = 10, Children = { lst, btnClear } }; }
public HomePage() { this.Title = "Home Page"; this.ToolbarItems.Add(new ToolbarItem("Charts", null, () => { Navigation.PushNonAwaited <ChartsPage>(); }) { AutomationId = "Charts" }); var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { HasUnevenRows = true, ItemTemplate = new DataTemplate(typeof(RandomUserCell)), AutomationId = "lstView" }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "Users"); Content = new StackLayout() { Children = { lstView } }; }
public HttpServicesPage() { this.Title = "Http Services"; this.ToolbarItems.Add(new ToolbarItem("Load", null, () => { VM.HttpDownloadStart.Execute(null); }) { AutomationId = "Load" }); var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { HasUnevenRows = true, ItemTemplate = new DataTemplate(typeof(RandomUserCell)), AutomationId = "lstView" }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "RandomUsers"); Content = new StackContainer(true) { Children = { lstView } }; }
public NationalitySelectionPage() { this.Title = "Options"; var optionLabel = new Label() { Text = "Nationality Options", TextColor = Color.LightGray }; var lst = new CoreListView(ListViewCachingStrategy.RecycleElement) { RowHeight = 45, MaintainSelection = false, ItemTemplate = new DataTemplate(typeof(NationalityCell)) }; lst.ItemTapped += (e, a) => { ((Nationality)a.Item).IsSelected = !((Nationality)a.Item).IsSelected; }; lst.SetBinding(CoreListView.ItemsSourceProperty, "Nationalities"); var btnProceed = new Button() { Text = "View Chart" }; btnProceed.SetBinding(Button.CommandProperty, "GetNationalityData"); Content = new StackLayout() { Children = { optionLabel, lst, btnProceed } }; }
public SlidingPage() { BackgroundColor = Color.FromHex("#b85921"); var monkey = new CachedImage() { Margin = 5, Source = "iconwhite.png" }; var navTitle = new Label() { Text = "Common Core", TextColor = Color.White, Margin = 5 }; var navSubtitle = new Label() { Text = "Options Menu", TextColor = Color.White, Style = CoreStyles.AddressCell }; var topPanel = new StackLayout() { Padding = new Thickness(10, 0, 10, 10), BackgroundColor = Color.FromHex("#b85921"), Orientation = StackOrientation.Horizontal, Children = { monkey, new StackLayout() { Children = { navTitle, navSubtitle } } } }; var listView = new CoreListView { BackgroundColor = Color.White, ItemTemplate = new DataTemplate(typeof(SlidingPageCell)), VerticalOptions = LayoutOptions.FillAndExpand, SeparatorVisibility = SeparatorVisibility.None, }; listView.SetBinding(CoreListView.ItemsSourceProperty, "MasterPageItems"); listView.SetBinding(CoreListView.ItemClickCommandProperty, "NavClicked"); Padding = new Thickness(0, 40, 0, 0); Icon = "hamburger.png"; Title = "Reference Guide"; Content = new StackContainer(true) { VerticalOptions = LayoutOptions.FillAndExpand, Children = { topPanel, listView } }; }
public StateView() { var lbl = new Label() { Text = "Select A State", Margin = 10 }; var top = new StackLayout() { BackgroundColor = Color.FromHex("#DF8049"), Children = { lbl } }; var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { VerticalOptions = LayoutOptions.CenterAndExpand, ItemTemplate = new DataTemplate(typeof(StateViewCell)), MaintainSelection = true }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "States"); var placeholder = new CompressedStackLayout() { HorizontalOptions = LayoutOptions.StartAndExpand }; var btn = new Button() { Margin = 5, Text = "Close", BackgroundColor = Color.Transparent, Command = new Command(() => { this.Close(); }) }; var bottom = new CompressedStackLayout() { Orientation = StackOrientation.Horizontal, Children = { placeholder, btn } }; Content = new CompressedStackLayout() { Children = { top, lstView, bottom } }; }
public FontsCollectionView() { this.Title = VM.FontType.ToString(); var list = new CoreListView() { ItemTemplate = new DataTemplate(typeof(FontsCollectionViewCell)), RowHeight = 75, SeparatorColor = Color.Transparent, SeparatorVisibility = SeparatorVisibility.None }; list.SetBinding(CoreListView.ItemsSourceProperty, "Items"); Content = list; }
public FavoritesPage() { this.Title = "Favorites"; this.BackgroundColor = Color.White; var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { HasUnevenRows = true, ItemTemplate = new DataTemplate(typeof(FavoritesCell)), AutomationId = "lstView", }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "Favorites"); Content = new StackLayout() { Children = { lstView } }; }
public ErrorsPage() { this.Title = "App Errors"; var lst = new CoreListView() { ItemTemplate = new DataTemplate(typeof(ErrorsPageCell)), ItemClickCommand = new Command((obj) => { var log = (ErrorLog)obj; VM.DialogPrompt.ShowMessage(new Prompt() { Title = "Error", Message = log.ErrorMessage }); }) }; lst.SetBinding(CoreListView.ItemsSourceProperty, "ErrorLogs"); var btnAdd = new CoreButton() { Text = "Add", Style = CoreStyles.LightOrange, AutomationId = "btnAdd", }; btnAdd.SetBinding(CoreButton.CommandProperty, "CreateErrorEntry"); var btnClear = new CoreButton() { Text = "Clear", Style = CoreStyles.LightOrange, AutomationId = "btnClear" }; btnClear.SetBinding(CoreButton.CommandProperty, "ClearErrorEntries"); Content = new StackContainer(true) { Padding = 20, Spacing = 10, Children = { lst, btnAdd, btnClear } }; }
public PaginagedListControl() { this.Title = "Paginated"; var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { HasUnevenRows = true, ItemTemplate = new DataTemplate(typeof(RandomUserCell)), AutomationId = "lstView" }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "PaginatedRandomUsers"); lstView.SetBinding(CoreListView.LoadMoreCommandProperty, "LoadMorePaginatedUsers"); lstView.SetBinding(CoreListView.SelectedItemProperty, "SelectedPagingatedUser"); Content = new StackLayout() { Children = { lstView } }; }
public ChatPage() { var lst = new CoreListView() { RowHeight = 100, HasUnevenRows = true, ItemTemplate = new MessageTemplateSelector(), SeparatorColor = Color.Transparent, SeparatorVisibility = SeparatorVisibility.None, VerticalOptions = LayoutOptions.FillAndExpand }; lst.SetBinding(CoreListView.ScrollIndexProperty, "MessageViewIndex"); lst.SetBinding(ListView.ItemsSourceProperty, "Messages"); var entry = new Entry() { Placeholder = "Message", HorizontalOptions = LayoutOptions.FillAndExpand }; entry.SetBinding(Entry.TextProperty, "TextMessage"); var send = new Button() { Text = "Send" }; send.SetBinding(Button.CommandProperty, "SendMessage"); var bottomPanel = new StackLayout() { Orientation = StackOrientation.Horizontal, Children = { entry, send } }; Content = new StackLayout() { Children = { lst, bottomPanel } }; }
public CardViewPage() { this.Title = "Card View"; var lst = new CoreListView() { RowHeight = (int)(CoreSettings.ScreenSize.Height * 0.4) + CoreSettings.On <int>(35, 45), ItemTemplate = new DataTemplate(typeof(CardViewCell)), SeparatorVisibility = SeparatorVisibility.None, SeparatorColor = Color.Transparent }; lst.SetBinding(CoreListView.ItemsSourceProperty, "CardCollection"); lst.Effects.Add(new HideListSeparatorEffect()); Content = new StackLayout() { Padding = 10, Children = { lst } }; }
public HomePage() { this.Title = "Home Page"; this.BackgroundColor = Color.White; var lstView = new CoreListView(ListViewCachingStrategy.RecycleElement) { HasUnevenRows = true, ItemTemplate = new DataTemplate(typeof(UsersCell)), AutomationId = "lstView", ItemClickCommand = new Command(async(obj) => { await CoreSettings.AppNav.PushAsync(new HomeDetailPage()); }) }; lstView.SetBinding(CoreListView.ItemsSourceProperty, "RandomUsers"); lstView.SetBinding(CoreListView.SelectedItemProperty, "SelectedRandomUser"); Content = new StackLayout() { Children = { lstView } }; }
public SomePage() { this.Title = "People"; this.ToolbarItems.Add(new ToolbarItem() { Text = "Add Person", Command = new Command(async() => { await CoreSettings.AppNav.PushAsync(new AddPerson()); }) }); var lst = new CoreListView(ListViewCachingStrategy.RecycleElement) { ItemTemplate = new DataTemplate(typeof(PersonCell)) }; lst.SetBinding(CoreListView.ItemsSourceProperty, "People"); Content = new StackLayout() { Padding = 10, Children = { lst } }; }
public TodoPage() { this.Title = "Todo List"; var fab = new CoreFloatingActionButton() { Size = FABControlSize.Normal, ColorNormal = CoreStyles.NavigationBarColor, ColorPressed = CoreStyles.NavigationBarColor.MultiplyAlpha(0.4), ImageName = "plus.png", }; fab.SetBinding(CoreFloatingActionButton.CommandProperty, "FABClicked"); AbsoluteLayout.SetLayoutFlags(fab, AbsoluteLayoutFlags.PositionProportional); AbsoluteLayout.SetLayoutBounds(fab, new Rectangle(0.95f, 0.95f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); var lst = new CoreListView() { IsPullToRefreshEnabled = true, ItemTemplate = new DataTemplate(typeof(TodoPageCell)), RowHeight = 65 }; lst.SetBinding(CoreListView.ItemsSourceProperty, "CurrentTodoList"); lst.SetBinding(CoreListView.IsRefreshingProperty, "IsRefreshing"); lst.SetBinding(CoreListView.RefreshCommandProperty, "RefreshData"); lst.SetBinding(CoreListView.IsVisibleProperty, "DataExists"); lst.Effects.Add(new HideListSeparatorEffect()); #if __IOS__ lst.Effects.Add(new RemoveEmptyRowsEffect()); #endif var imgLabel = new Label() { FontSize = 75, TextColor = Color.LightGray, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }; imgLabel.SetBinding(Label.TextProperty, "EmptyDataIcon.Unicode"); imgLabel.SetBinding(Label.FontFamilyProperty, "EmptyDataIcon.FontFamily"); var imgDescription = new Label() { TextColor = Color.LightGray, FontSize = 32, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, Text = "The dataset is empty. Try adding an item manually." }; var emptyPanel = new StackLayout() { Padding = 30, Children = { imgLabel, imgDescription } }; emptyPanel.SetBinding(StackLayout.IsVisibleProperty, new Binding(path: "DataExists", converter: AppConverters.ReverseBoolean)); Content = new StackLayout() { Children = { lst, emptyPanel } }; AbsoluteLayer.Children.Add(fab); }
public AppMenuPage() { Icon = "hamburger.png"; Title = "Reference Guide"; BackgroundColor = CoreStyles.NavigationBarColor; Padding = new Thickness(0, 40, 0, 0); var personImage = new CachedImage() { Margin = 5, Source = "personMenuPlaceholder.png" }; var navTitle = new Label() { Text = "Jack Sparrow", TextColor = Color.White, FontSize = 24, Margin = new Thickness(5, 15, 5, 0) }; var navSubtitle = new Label() { Text = "Administrator", TextColor = Color.White, FontSize = 14, Margin = new Thickness(5, 0, 5, 0) }; var topPanel = new StackLayout() { Padding = new Thickness(10, 0, 10, 10), BackgroundColor = CoreStyles.NavigationBarColor, Orientation = StackOrientation.Horizontal, Children = { personImage, new StackLayout() { Children = { navTitle, navSubtitle } } } }; var listView = new CoreListView { BackgroundColor = CoreStyles.LightOrangeBackground, ItemTemplate = new DataTemplate(typeof(AppMenuCell)), VerticalOptions = LayoutOptions.FillAndExpand, SeparatorVisibility = SeparatorVisibility.None, RowHeight = 50 }; listView.SetBinding(CoreListView.ItemsSourceProperty, "MasterPageItems"); listView.SetBinding(CoreListView.ItemClickCommandProperty, "NavClicked"); Content = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Children = { topPanel, listView } }; }