xamarin/Xamarin.Forms

[Bug] UWP ListView, ItemTemplate with a Label.IsVisible bound to ".", property converter receives the wrong model

Aberta

#8.827 aberto em 10 de dez. de 2019

 (7 comentários) (3 reações) (0 responsável)C# (1.926 forks)batch import
a/binding ⛓a/listviewe/4 :clock4:help wantedp/UWPt/bug :bug:up-for-grabs

Métricas do repositório

Stars
 (5.644 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Description

I have a page that has a view model with an ObservableList of items, and a ListView that binds to that list. The ListView has an ItemTemplate with a number of labels, those labels bind to individual properties within the model, however one of the labels binds to IsVisible using the "." notation so that my property converter can evaluate several properties. This works fine on iOS and Android, but on UWP my converter is throwing an error as it isn't getting the item binding context, it is getting the ListView binding context instead!

Steps to Reproduce

  1. Create a page with a model that contains a list of other models, and a listview
  2. Bind the listview itemssource to the model list
  3. Add an ItemTemplate to the listview containing a label that binds to "." with a property converter
  4. Run on UWP

Expected Behavior

The app correctly provides the Items model to the label property converter

Actual Behavior

Crash On UWP as the property converter receives the page BindingContext instead of the item model

Basic Information

  • Version with issue:
  • Last known good version: Unknown
  • Platform Target Frameworks:
    • UWP:

Guia do colaborador