How can I bind to to an explicit interface indexer implementation?
Suppose we have two interfaces
public interface ITestCaseInterface1
{
string this[string index] { get; }
}
public interface ITestCaseInterface2
{
string this[string index] { get; }
}
a class implementing both
public class TestCaseClass : ITestCaseInterface1, ITestCaseInterface2
{
string ITestCaseInterface1.this[string index] => $"{index}-Interface1";
string ITestCaseInterface2.this[string index] => $"{index}-Interface2";
}
and a DataTemplate
<DataTemplate DataType="{x:Type local:TestCaseClass}">
<TextBlock Text="**BINDING**"></TextBlock>
</DataTemplate>
What I tried so far without any success
<TextBlock Text="{Binding (local:ITestCaseInterface1[abc])}" />
<TextBlock Text="{Binding (local:ITestCaseInterface1)[abc]}" />
<TextBlock Text="{Binding (local:ITestCaseInterface1.Item[abc])}" />
<TextBlock Text="{Binding (local:ITestCaseInterface1.Item)[abc]}" />
How should my Binding
look like?
Thanks