parent
18fc06f6b3
commit
bf8399d8d1
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,49 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||||
|
<ContentPage x:Class="CollectionViewDemos.Views.ThirdPage" |
||||||
|
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
||||||
|
xmlns:viewModels="clr-namespace:CollectionViewDemos.ViewModels" |
||||||
|
Title="ThirdPage"> |
||||||
|
<ContentPage.BindingContext> |
||||||
|
<viewModels:MonkeysViewModel /> |
||||||
|
</ContentPage.BindingContext> |
||||||
|
|
||||||
|
<VerticalStackLayout> |
||||||
|
<CollectionView x:Name="mainCollectionView" ItemsSource="{Binding Monkeys}"> |
||||||
|
<CollectionView.ItemTemplate> |
||||||
|
<DataTemplate> |
||||||
|
<SwipeView> |
||||||
|
<SwipeView.LeftItems> |
||||||
|
<SwipeItems> |
||||||
|
<SwipeItem BackgroundColor="LightGreen" |
||||||
|
Command="{Binding Source={x:Reference mainCollectionView}, Path=BindingContext.FavoriteCommand}" |
||||||
|
CommandParameter="{Binding}" |
||||||
|
IconImageSource="favorite.png" Text="즐겨찾기" /> |
||||||
|
<SwipeItem BackgroundColor="LightSalmon" |
||||||
|
Command="{Binding Source={RelativeSource AncestorType={x:Type CollectionView}}, Path=BindingContext.RemoveCommand}" |
||||||
|
CommandParameter="{Binding}" |
||||||
|
IconImageSource="remove.png" Text="삭제" /> |
||||||
|
</SwipeItems> |
||||||
|
</SwipeView.LeftItems> |
||||||
|
|
||||||
|
<Grid Padding="10" BackgroundColor="WhiteSmoke" |
||||||
|
ColumnDefinitions="Auto,Auto" RowDefinitions="Auto,Auto"> |
||||||
|
<Image Grid.RowSpan="2" |
||||||
|
Aspect="AspectFill" HeightRequest="60" |
||||||
|
Source="{Binding ImageUrl}" |
||||||
|
WidthRequest="60" /> |
||||||
|
<Label Grid.Column="1" |
||||||
|
FontAttributes="Bold" |
||||||
|
Text="{Binding Name}" /> |
||||||
|
<Label Grid.Row="1" Grid.Column="1" |
||||||
|
FontAttributes="Italic" |
||||||
|
Text="{Binding Location}" |
||||||
|
VerticalOptions="End" /> |
||||||
|
</Grid> |
||||||
|
</SwipeView> |
||||||
|
|
||||||
|
</DataTemplate> |
||||||
|
</CollectionView.ItemTemplate> |
||||||
|
</CollectionView> |
||||||
|
</VerticalStackLayout> |
||||||
|
</ContentPage> |
@ -0,0 +1,9 @@ |
|||||||
|
namespace CollectionViewDemos.Views; |
||||||
|
|
||||||
|
public partial class ThirdPage : ContentPage |
||||||
|
{ |
||||||
|
public ThirdPage() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue