If I don’t use DataType attribute on the DataTemplate VS complaints on each data binding below because it does not know what type is bound to the element. That is not a compile error and does not prevent the app building.
If I use DataType attribute, and I usually do for Xamarin Froms apps when I create apps for Android and iOS I’m getting a compiler error
8>Views\ListPage.xaml : XamlC error : Value cannot be null.
8>Views\ListPage.xaml : XamlC error : Parameter name: type
Here is the XAML:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:Wearable.Tizen.ViewModels;assembly=Wearable.Tizen"
x:Class="Wearable.Tizen.Views.ListPage"
NavigationPage.HasNavigationBar="False"
>
<ListView ItemsSource="{Binding ItemList}" ItemTapped="List_ItemTapped" CachingStrategy="RecycleElement">
<ListView.ItemTemplate>
<DataTemplate x:DataType="viewModels:ViewModel">
<ViewCell>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding FrontImageSource}" WidthRequest="88" HeightRequest="66" />
<StackLayout Grid.Column="1" Orientation="Vertical">
<Label LineBreakMode="TailTruncation" Text="{Binding Name}" />
<StackLayout Orientation="Horizontal">
<Label LineBreakMode="NoWrap" Text="Done: " />
<Label LineBreakMode="TailTruncation" Text="{Binding LastDoneFormatted}" />
</StackLayout>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Is this attribute banned from usage on Tizen or the usage style should be different, maybe the namespace or something else?