I can bind to a collection item using index:
<TextBlock FontStyle="Italic" Text="{Binding Path=Exchanges[0].Name}" />
but what about using a dictionary key?
Path=Exchanges['AMEX'].Name
Its very easy to do in WPF in comparison of windows Application programming. Two way binding is used when we want to update some controls property when some other related controls property change and when source property change the actual control also updates its property.
Binding path syntax. Use the Path property to specify the source value you want to bind to: In the simplest case, the Path property value is the name of the property of the source object to use for the binding, such as Path=PropertyName . Subproperties of a property can be specified by a similar syntax as in C#.
yep.. works like a charm
<TextBlock FontStyle="Italic" Text="{Binding Path=ExchangesDictionary[AMEX].Name}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With