Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Compiled Bindings with Picker.ItemDisplayBinding #5240

Closed
tbrushwyler opened this issue Feb 13, 2019 · 4 comments
Closed

Compiled Bindings with Picker.ItemDisplayBinding #5240

tbrushwyler opened this issue Feb 13, 2019 · 4 comments

Comments

@tbrushwyler
Copy link

Description

When using Compiled Bindings, there is a compilation error when setting the Picker.ItemDisplayBinding property using the Binding markup extension.

I want to be able to set the data type of a visual element to enable compiled bindings and then set the Picker.ItemDisplayBinding property on one of its ancestors without causing build errors.

Steps to Reproduce

  1. Open the reproduction solution (zip, git).
  2. Build the solution

Expected Behavior

The solution builds and I can run the app and see three pickers on the page (one should display the result of .ToString() and the other two should display the Name property).

Actual Behavior

There is a build error:

XF_CompiledBindings_Picker/XF_CompiledBindings_Picker/MainPage.xaml(49,49): Error: Position 15:49. Binding: Property 'Name' not found on 'XF_CompiledBindings_Picker.MainPageViewModel' (XF_CompiledBindings_Picker)

Basic Information

  • Version with issue: Xamarin.Forms 3.5.0.129452 (also tested against 4.0.0.135213-pre4)
  • Last known good version: none
  • IDE: 7.7.4
  • Platform Target Frameworks:
    • iOS: 12.2.1.15
    • Android: 9.1.8.0
  • Nuget Packages: Xamarin.Forms 3.5.0.129452
@pauldipietro pauldipietro added this to New in Triage Feb 13, 2019
@StephaneDelcroix StephaneDelcroix self-assigned this Feb 19, 2019
@StephaneDelcroix
Copy link
Member

ItemDisplayBinding is kinda special, as it uses the same syntax as setting a binding, but instead sets a property

@samhouts samhouts moved this from New to Ready For Work in Triage Feb 26, 2019
@samhouts samhouts added this to To do in Other Ready For Work Feb 26, 2019
@samhouts samhouts removed this from Ready For Work in Triage Feb 26, 2019
@tranb3r
Copy link

tranb3r commented Jul 10, 2019

@StephaneDelcroix
This issue was opened 5 months ago, and so far no progress has been done.
Do you think it could be reprioritized ?

@StephaneDelcroix
Copy link
Member

x:DataType="{Null}" in your sample should be x:DataType="{x:Null}" or it will fail with 4.1

@tranb3r
Copy link

tranb3r commented Jul 10, 2019

Yes the sample is wrong, obviously it's x:DataType="{x:Null}".
However, I think we agree this "{x:Null}" datatype is just an ugly workaround.
The real question is: can you fix the issue preventing the sample to build when x:DataType is not set to {x:Null} ?

StephaneDelcroix added a commit that referenced this issue Jul 10, 2019
binding passed as properties don't have a valid datatype, so do not compile those.

- fixes #5240
@samhouts samhouts added this to In Progress in v4.2.0 Jul 10, 2019
@samhouts samhouts moved this from In Progress to Done in v4.2.0 Jul 15, 2019
Other Ready For Work automation moved this from To do to Done Jul 18, 2019
@samhouts samhouts removed this from Done in Other Ready For Work May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v4.2.0
  
Done
Development

No branches or pull requests

4 participants