Forum Xamarin.Forms

Create DataTemplate for Custom Renderer on Windows Phone

Emixam23Emixam23 USMember ✭✭✭
edited June 2016 in Xamarin.Forms


I'm following this tutorial Customizing a ViewCell

However, I don't understand where can I put the last piece of code at the bottom of the tutorial..

<DataTemplate x:Key="ListViewItemTemplate">
<Grid Background="LightYellow">
        <local:ConcatImageExtensionConverter x:Name="ConcatImageExtensionConverter" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <ColumnDefinition Width="0.40*" />
        <ColumnDefinition Width="0.40*"/>
        <ColumnDefinition Width="0.20*" />
    <TextBlock Grid.ColumnSpan="2" Foreground="#7F3300" FontStyle="Italic" FontSize="22" VerticalAlignment="Top" Text="{Binding Name}" />
    <TextBlock Grid.RowSpan="2" Grid.Column="1" Foreground="#267F00" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Category}" />
    <Image Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Source="{Binding ImageFilename, Converter={StaticResource ConcatImageExtensionConverter}}" Width="50" Height="50" />
    <Line Grid.Row="1" Grid.ColumnSpan="3" X1="0" X2="1" Margin="30,20,0,0" StrokeThickness="1" Stroke="LightGray" Stretch="Fill" VerticalAlignment="Bottom" />

Does anyone can help me?

Best Answer


  • Emixam23Emixam23 USMember ✭✭✭

    Ho ok I didn't know neither where to put the resource dictionary nor in which file I had to do (create a new file or put in existing file) Thank !

Sign In or Register to comment.