maui
maui copied to clipboard
Listview Binding Data not display (in Release)
Description
`
<ListView ItemsSource="{Binding Aa}"
MaximumWidthRequest="500" ItemSelected="ListView_ItemSelected">
<ListView.ItemTemplate>
<DataTemplate x:DataType="model:SVPokemon">
<ViewCell>
<Grid Padding="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image MaximumWidthRequest="{x:OnPlatform WinUI=50, Android=30}"
Margin="0,-8,0,0"
Source="{Binding}"
IsAnimationPlaying="False">
</Image>
<Label Grid.Column="1"
Text="{Binding .}"
FontAttributes="Bold"
VerticalTextAlignment="Center" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>`

Debug is work norma;
Steps to Reproduce
like Description
Link to public reproduction project repository
https://github.com/ssccinng/PokeSci/tree/master/SVPokeDex
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android11 win11
Did you find any workaround?
No response
Relevant log output
No response
win 11
Debug
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Duplicate of https://github.com/dotnet/maui/issues/11806
There is maybe an issue with XamlC for release, but in your specific case you have a DataType of model:SVPokemon, but that is incorrect. The DataType should be of the item, or x:DataType="{x:Type x:String}" because the aa field is an ObservableCollection<string>.
See XAML: https://github.com/ssccinng/PokeSci/blob/master/SVPokeDex/View/PokeDexPage.xaml#L44
See VM: https://github.com/ssccinng/PokeSci/blob/master/SVPokeDex/ViewModel/PokeDexViewModel.cs#L20