[Feature] x:Bind should support general string indexers without interface in C#
See original GitHub issueDescribe the bug The documentation for x:Bind here in the ‘path to the function’ section specifies:
The path to the function is specified like other property paths and can include dots (.), indexers or casts to locate the function.
However, it appears that non-integer based indexers, e.g. strings, are not supported?
I was trying to bind directly to a Graph function with the Windows Community Toolkit’s GraphPresenter
:
RequestBuilder="{x:Bind providers:ProviderManager.Instance.GlobalProvider.Graph.Teams['<guid here>'].Channels['<guid thing here>'].Messages, Mode=OneWay}"
As these classes use string indexers to build the query to the Graph, E.g.
ITeamRequestBuilder this[string id] { get; }
However VS tells me in the x:Bind expression that I have provided an “invalid index value” and “WMC1110: Invalid binding path … Unexpected array indexer”.
Expected behavior I would have expected string indexers to work just as I can pass them into function parameters with x:Bind in single-quotes.
Version Info NuGet package version: WUX
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2020 Update (19041) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top GitHub Comments
Alright I see thank you for the insight. I will go ahead and place it in the backlog, but can’t quite guarantee an ETA for it yet. I will leave the issue open.
Sorry the triage team interpretated the conversation differently. We can reuse this as a feature proposal