Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ListView x:Name="listView" ItemsSource="{Binding}" ItemSelected="ListView_ItemSelected">
- <ListView.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <ViewCell.View>
- <StackLayout Orientation="Horizontal">
- <Label Text="{Binding NameBook}" FontSize="Medium" />
- </StackLayout>
- </ViewCell.View>
- </ViewCell>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- <ListView x:Name="listView" ItemsSource="{Binding}" ItemSelected="ListView_ItemSelected">
- listView.SetBinding(ListView.ItemsSourceProperty, new Binding("."));
- listView.SetBinding(ListView.ItemsSourceProperty, new Binding() {Source = this});
- Label label = new Label()
- {
- FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
- };
- label.SetBinding(Label.TextProperty, "NameBook");
- sl = new StackLayout()
- {
- };
- listView = new ListView()
- {
- ItemTemplate = new DataTemplate(() =>
- {
- return new ViewCell
- {
- View = new StackLayout
- {
- Orientation = StackOrientation.Horizontal,
- Children =
- {
- label
- }
- }
- };
- })
- };
- listView.SetBinding(ListView.ItemsSourceProperty, new Binding("."));
- listView.ItemSelected += ListView_ItemSelected;
- Button btn = new Button()
- {
- Text = "Добавить"
- };
- btn.Pressed += CreateFriend;
- sl.Children.Add(listView);
- sl.Children.Add(btn);
- Content = sl;
Add Comment
Please, Sign In to add comment