0
I have a XAML with the following structure:
<swipeview:SwipeCollectionView ItemsSource="{Binding Items}" x:Name="swipeListView">
<swipeview:SwipeCollectionView.ItemTemplate>
<DataTemplate>
<material:MaterialCard Elevation="1" x:Name="Card" Padding="1" BackgroundColor="White" WidthRequest="{Binding Source={x:Reference swipeListView}, Path=Width}" CornerRadius="4" Margin="5,5,5,5">
<StackLayout>
<StackLayout Padding="15">
<Button IsVisible="True" Text="SwipeRight" HorizontalOptions="EndAndExpand" Clicked="SwipeClick" CommandParameter="{Reference Name=loopedElement}" />
</StackLayout>
<swipeview:SwipeItemView x:Name="loopedElement" BoundItem="{Binding .}" ChangeOpacity="True" IsVisible="True" SwipeRightCompleted="SwipeRightCompleted" SwipeLeftCompleted="SwipeLeftCompleted">
<!--Swipe Main Content -->
<swipeview:SwipeItemView.MainContent>
<StackLayout>
<material:MaterialCard Elevation="1" Padding="2" BorderColor="Gray" CornerRadius="4" x:Name="mcard" >
(...)
However, mcard does not appear in code Behind.
The intention is that when the button is clicked, the Translationx property of the Materialcard element will be changed.
I can access swipeListView in code Behind but not mcard.
I’ve been stuck in this for days. I thank everyone who can help.