Skip to content

Instantly share code, notes, and snippets.

@tugcearar
Created January 3, 2020 12:27
Show Gist options
  • Save tugcearar/8d23db5b47d9d250c150857835e7ac0d to your computer and use it in GitHub Desktop.
Save tugcearar/8d23db5b47d9d250c150857835e7ac0d to your computer and use it in GitHub Desktop.
<?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