Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Use View Class in Xaml

ChristopheDOSSANTOSChristopheDOSSANTOS USMember
edited July 2015 in Xamarin.Forms

Hello,

I create a content page with listview in xaml file and I want import an other xaml ViewCell in my listview.

how can I do ?

Kristof,

My listview

`
<ContentPage.Content>

<ListView.ItemTemplate>

IMPORT HERE

</ListView.ItemTemplate>

</ContentPage.Content>

`

my viewCELL IN OTHER FILE

<ViewCell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Savelys_Dev.Article_ViewCell"> <ViewCell.View> <StackLayout Spacing="10" Orientation="Horizontal"> <Frame OutlineColor="Black" BackgroundColor="White" HorizontalOptions="FillAndExpand" HasShadow="true"> <StackLayout Orientation="Horizontal" Spacing="10"> <StackLayout Padding="10,10,10,10" BackgroundColor="{Binding color}"> <Label x:Name="Lettre" TextColor="Black" FontAttributes="Bold" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" Text="{Binding lettre}" > </Label> </StackLayout> <StackLayout Orientation="Vertical" VerticalOptions="Center"> <Label FontAttributes="Bold" TextColor="#054484" Text="{Binding nom}"> </Label> <Label TextColor="Black" Text="{Binding texte}"> </Label> <Label TextColor="Black" Text="{Binding date}"> </Label> </StackLayout> </StackLayout> </Frame> </StackLayout> </ViewCell.View> </ViewCell>

Sign In or Register to comment.