Reputation: 43331
I have this XAML code:
<ListBox DataContext="{Binding Tables[Suppliers]}" ItemsSource="{Binding}"> </ListBox>
In the project I have the following code:
namespace Suppliers { class DBServer { public const string TableSuppliers = "Suppliers"; }
How can I use Suppliers.DBServer.TableSuppliers in the XAML page instead of hard-coded Suppliers:
{Binding Tables[ ??? ]}
Upvotes: 1
Views: 1088
Reputation: 7254
If this what is inside [] is a string you can always use a constant like {x:Static c:Constants.X}
Upvotes: 1