public DeparturesContentPage (Route selectedRoute) { var indicator = new ActivityIndicator() { HorizontalOptions = LayoutOptions.CenterAndExpand }; this.Title = "Departures"; var listView = new ListView { ItemTemplate = new DataTemplate (typeof(TextCell)) { Bindings = { { TextCell.TextProperty, new Binding ("Time") } } } }; var root = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Children = { listView, indicator } }; this.Content = root; Initialize (selectedRoute,listView,indicator); }
async void initialize (Route route) { this.Title = "Stops"; this.Content = new ListView { ItemsSource = await FindStopsByRouteId (route.Id), ItemTemplate = new DataTemplate (typeof(TextCell)) { Bindings = { { TextCell.TextProperty, new Binding ("Name") } } } }; }
async void Initialize (Route selectedRoute,ListView listView,ActivityIndicator indicator) { ActivateIndicator (indicator); listView.ItemsSource = await FindDeparturesByRouteId (selectedRoute.Id); DeactivateIndicator (indicator); }
bool equals(Route obj){ return obj != null && this.Id.Equals (obj.Id); }
void initializeChildren (Route route) { this.Children.Add (new DeparturesContentPage (route)); this.Children.Add (new StopsContentPage (route)); }
public DetailPage (Route route) { InitializeComponent (); this.Title = route.LongName; initializeChildren (route); }
public StopsContentPage (Route route) { initialize (route); }