Exemplo n.º 1
0
        private void InitializeBindings()
        {
            this.DelayBind(() =>
            {
                var source = new MediaGridViewSource(CollectionView);

                var set = (this).CreateBindingSet <ContentGroupCell, ContentGroup>();
                set.Bind(TitleLabel).To(vm => vm.Title);
                set.Bind(ViewAllButton).To(vm => vm.OnViewAllClickCommand);
                set.Bind(source).For(x => x.ItemsSource).To(vm => vm.Collection);
                set.Bind(source).For(x => x.SelectionChangedCommand).To(vm => vm.OnItemClickCommand);
                set.Bind(MessageTitleLabel).For(x => x.Text).To(vm => vm.Collection.ErrorHeader);
                set.Bind(MessageDescriptionLabel).For(x => x.Text).To(vm => vm.Collection.ErrorDescription);
                set.Bind(IsLoadingIndicator).For(x => x.Hidden).WithConversion <InverseBooleanConverter>().To(vm => vm.Collection.IsLoading);
                set.Bind(IsLoadingIndicator).For(x => x.IsAnimating).To(vm => vm.Collection.IsLoading);
                set.Apply();

                ViewAllButton.SetTitleColor(ColorHelper.Accent.ToPlatformColor(), UIControlState.Normal);
                TitleLabel.TextColor     = ColorHelper.Text0.ToPlatformColor();
                IsLoadingIndicator.Color = ColorHelper.Text0.ToPlatformColor();

                CollectionView.Source = source;
                CollectionView.ReloadData();
            });
        }
 protected void ViewAllButton_Click(object sender, EventArgs e)
 {
     if (ViewAllButton.WasShowingViewPagesImage())
     {
         ReportPanel.ShowPager();
     }
     else
     {
         ReportPanel.ShowAllRecords();
     }
 }