Created
January 3, 2020 12:27
-
-
Save tugcearar/8d23db5b47d9d250c150857835e7ac0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="MyProject.Views.MyPage" | |
xmlns:vm="clr-namespace:MyProject.ViewModels" | |
x:Name="myPage"> | |
<ContentPage.BindingContext> | |
<vm:MyPageViewModel/> | |
</ContentPage.BindingContext> | |
<ContentPage.Content> | |
<StackLayout x:Name="myBindableLayout" Orientation="Vertical" | |
BindableLayout.ItemsSource="{Binding MyList,Mode=TwoWay}"> | |
<BindableLayout.ItemTemplate> | |
<DataTemplate> | |
<StackLayout> | |
<Label Text="{Binding Name}"/> | |
<Button Text="Delete" | |
Command="{Binding Path=BindingContext.DeleteCommand, Source={x:Reference Name=myBindableLayout}}" | |
HorizontalOptions="End" | |
VerticalOptions="Center" | |
CommandParameter="{Binding .}" ></Button> | |
</StackLayout> | |
</DataTemplate> | |
</BindableLayout.ItemTemplate> | |
</StackLayout> | |
</ContentPage.Content> | |
</ContentPage> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment