public MasterPage<Account> BuildAccounts(OptionItem option) { var page = new MasterPage<Account>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.TextProperty, "Company"); return page; }
public MasterPage<Opportunity> BuildOpportunities(OptionItem option) { var page = new MasterPage<Opportunity>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.TextProperty, "Company"); cell.SetBinding(TextCell.DetailProperty, new Binding("EstimatedAmount", stringFormat: "{0:C}")); return page; }
Page PageForOption (OptionItem option) { var builder = new MasterPageBuilder (); if (option.Title == "Contacts") return builder.BuildContacts (option); if (option.Title == "Leads") return builder.BuildLeads (option); if (option.Title == "Accounts") return builder.BuildAccounts (option); if (option.Title == "Opportunities") return builder.BuildOpportunities (option); throw new NotImplementedException (string.Format ("Unknown menu option: {0}", option.Title)); }
void NavigateTo(OptionItem option) { if (previousItem != null) previousItem.Selected = false; option.Selected = true; previousItem = option; var displayPage = PageForOption(option); Detail = new NavigationPage(displayPage) { Tint = Helpers.Color.Blue.ToFormsColor(), }; IsPresented = false; }
Page PageForOption (OptionItem option) { if (option.Title == "Contacts") return new MasterPage<Contact>(option); if (option.Title == "Leads") return new MasterPage<Lead>(option); if (option.Title == "Accounts") { var page = new MasterPage<Account>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.TextProperty, "Company"); return page; } if (option.Title == "Opportunities") { var page = new MasterPage<Opportunity>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.DetailProperty, "EstimatedAmount"); return page; } throw new NotImplementedException("Unknown menu option: " + option.Title); }
void NavigateTo(OptionItem option) { if (previousItem != null) previousItem.Selected = false; option.Selected = true; previousItem = option; var displayPage = PageForOption(option); #if WINDOWS_PHONE Detail = new ContentPage();//work around to clear current page. #endif var color = Helpers.Color.Blue.ToFormsColor (); Detail = new NavigationPage (displayPage) { BarBackgroundColor = color, BarTextColor = Color.White }; IsPresented = false; }
Page PageForOption (OptionItem option) { // TODO: Refactor this to the Builder pattern (see ICellFactory). if (option.Title == "Contacts") return new MasterPage<Contact>(option); if (option.Title == "Leads") return new MasterPage<Lead>(option); if (option.Title == "Accounts") { var page = new MasterPage<Account>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.TextProperty, "Company"); return page; } if (option.Title == "Opportunities") { var page = new MasterPage<Opportunity>(option); var cell = page.List.Cell; cell.SetBinding(TextCell.TextProperty, "Company"); cell.SetBinding(TextCell.DetailProperty, new Binding("EstimatedAmount", stringFormat: "{0:C}")); return page; } throw new NotImplementedException (string.Format ("Unknown menu option: {0}", option.Title)); }
public MasterPage<Contact> BuildContacts(OptionItem option) { return new MasterPage<Contact>(option); }
public MasterPage<Lead> BuildLeads(OptionItem option) { return new MasterPage<Lead>(option); }