public CustomersPage() { #region customer list activity inidicator ActivityIndicator customerListActivityIndicator = new ActivityIndicator() { HeightRequest = Sizes.MediumRowHeight }; customerListActivityIndicator.SetBinding(IsEnabledProperty, "IsBusy"); customerListActivityIndicator.SetBinding(IsVisibleProperty, "IsBusy"); customerListActivityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy"); #endregion #region customer list CustomerListView customerListView = new CustomerListView(); customerListView.SetBinding(CustomerListView.ItemsSourceProperty, "Accounts"); customerListView.SetBinding(IsEnabledProperty, "IsBusy", converter: new InverseBooleanConverter()); customerListView.SetBinding(IsVisibleProperty, "IsBusy", converter: new InverseBooleanConverter()); customerListView.ItemTapped += async(sender, e) => { Account account = (Account)e.Item; await PushTabbedPage(account); }; #endregion #region compose view hierarchy Content = new UnspacedStackLayout() { Children = { customerListActivityIndicator, customerListView }, Padding = Device.OnPlatform(Thicknesses.IosStatusBar, Thicknesses.Empty, Thicknesses.Empty) }; #endregion #region wire up MessagingCenter // Catch the login success message from the MessagingCenter. // This is really only here for Android, which doesn't fire the OnAppearing() method in the same way that iOS does (every time the page appears on screen). Device.OnPlatform(Android: () => MessagingCenter.Subscribe <CustomersPage>(this, MessagingServiceConstants.AUTHENTICATED, sender => OnAppearing())); #endregion }
public CustomersPage() { #region customer list activity inidicator ActivityIndicator customerListActivityIndicator = new ActivityIndicator() { HeightRequest = Sizes.MediumRowHeight }; customerListActivityIndicator.SetBinding(IsEnabledProperty, "IsBusy"); customerListActivityIndicator.SetBinding(IsVisibleProperty, "IsBusy"); customerListActivityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsBusy"); #endregion #region customer list CustomerListView customerListView = new CustomerListView(); customerListView.SetBinding(CustomerListView.ItemsSourceProperty, "Accounts"); customerListView.SetBinding(IsEnabledProperty, "IsBusy", converter: new InverseBooleanConverter()); customerListView.SetBinding(IsVisibleProperty, "IsBusy", converter: new InverseBooleanConverter()); customerListView.ItemTapped += async(sender, e) => await App.ExecuteIfConnected(async() => { Account account = (Account)e.Item; await PushTabbedPage(account); }); #endregion #region compose view hierarchy Content = new UnspacedStackLayout() { Children = { customerListActivityIndicator, customerListView }, Padding = Device.OnPlatform(Thicknesses.IosStatusBar, Thicknesses.Empty, Thicknesses.Empty) }; #endregion }