예제 #1
0
        private ListViewComponent AddListView()
        {
            ListComponent = new ListViewComponent(ListViewCachingStrategy.RecycleElementAndDataTemplate)
            {
                BackgroundColor = Constants.DEFAULT_MAIN_BACKGROUND_COLOR,
                SeparatorColor  = Constants.DEFAULT_TEXT_COLOR,
            };

            // Impede que, ao selecionar o item, ele fique selecionado.
            ListComponent.ItemSelected += (o, e) => { ListComponent.SelectedItem = null; };
            ListComponent.ItemTemplate  = new DataTemplate(typeof(RequestListDataTemplate));
            ListComponent.ItemsSource   = pessoaList;

            var nomeLabel = new Label {
                FontAttributes = FontAttributes.Bold, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
            };
            var idadeLabel = new Label();
            var serieLabel = new Label {
                HorizontalTextAlignment = TextAlignment.End
            };

            nomeLabel.SetBinding(Label.TextProperty, "Nome");
            idadeLabel.SetBinding(Label.TextProperty, "Idade");
            serieLabel.SetBinding(Label.TextProperty, "Serie");

            return(ListComponent);
        }
예제 #2
0
 public HomeController(ListViewComponent listComponent)
 {
     _listComponent = listComponent;
 }