You are on page 1of 2

<!

-- xaml for listview -->


<ListView
x:Name="listView"
ItemsSource="{Binding CartItems}"
WidthRequest="370"
VerticalOptions="FillAndExpand"
BackgroundColor="{DynamicResource NAVIGATION_BACKGROUND_COLOR}"
HasUnevenRows="True" >

<ListView.ItemTemplate>
<DataTemplate>
<uiElements:CartViewCell />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

<!-- Xaml for "uiElements:CartViewCell" ( my ViewCell) -->


<ViewCell.View>
<AbsoluteLayout
x:Name="MainLayout"
HeightRequest="50"
Margin="0, 5, 0, 0">

<AbsoluteLayout.Resources>
<ResourceDictionary>
<converters:EllipsisStringConverter
x:Key="EllipsisStringConverter" />
</ResourceDictionary>
</AbsoluteLayout.Resources>

<AbsoluteLayout.GestureRecognizers>
<PanGestureRecognizer PanUpdated="SwipeStarted" />
</AbsoluteLayout.GestureRecognizers>

<StackLayout
x:Name="DeleteLayout"
Orientation="Horizontal"
BackgroundColor="{DynamicResource DELETE_BACKGROUND_COLOR}"
AbsoluteLayout.LayoutBounds="0.5, 0.5, 1, 1"
AbsoluteLayout.LayoutFlags="All"
IsVisible="False">

<Image
Source="remove_all_items_icon.png"
WidthRequest="1"
HeightRequest="1"
Margin="270, 0, 0, 0"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
</StackLayout>

<swipeElements:StackLayoutWithSwipeSupport
x:Name="InformationLayout"
Orientation="Horizontal"
BackgroundColor="{DynamicResource ITEM_BACKGROUND_COLOR}"
AbsoluteLayout.LayoutBounds="0.5, 0.5, 1, 1"
AbsoluteLayout.LayoutFlags="All" >
<StackLayout
Orientation="Horizontal"
WidthRequest="272">
<Label
x:Name="Test"
Text="{Binding Title, Converter={StaticResource
EllipsisStringConverter}, ConverterParameter=35}"
TextColor="{DynamicResource LABEL_TEXT_COLOR}"
VerticalOptions="CenterAndExpand"
Margin="10,0,0,0" />
<Label
Text="{Binding Quantity, StringFormat='x {0}'}"
TextColor="{DynamicResource LABEL_Company_TEXT_COLOR}"
HorizontalOptions="EndAndExpand"
Margin="0,0,5,0"
VerticalOptions="CenterAndExpand" />
</StackLayout>

<BoxView
Color="{DynamicResource LINE_COLOR}"
WidthRequest="3"
VerticalOptions="FillAndExpand"
Margin="6, 0, 0, 0" />

<StackLayout
Orientation="Horizontal"
WidthRequest="89">
<Label
Text="{Binding Price}"
VerticalOptions="CenterAndExpand"
TextColor="{DynamicResource LABEL_TEXT_COLOR}"
Margin="5,5,0,5" />
<Label
Text="Sek"
HorizontalOptions="EndAndExpand"
VerticalOptions="CenterAndExpand"
TextColor="{DynamicResource LABEL_TEXT_COLOR}"
Margin="0,5,5,5" />
</StackLayout>
</swipeElements:StackLayoutWithSwipeSupport>

</AbsoluteLayout>

</ViewCell.View>

You might also like