Silverlight 4 Binding to ConverterParameter
- by FrEEzE2046
Hello everybody,
I have a ValueConverter which needs to be called with a dynamic parameter, depending on a property. I can't see a way to do this ...
Width="{Binding ActualWidthValue, Source={StaticResource VisibleSize}, Converter={StaticResource Fraction}}"
The "Fraction" converter get's (or should get) a parameter of type System.Size, which contains a numerator and denumerator. This value (should) depend on a ItemCollection.Count. Resetting the ItemCollection should reinvoke the Converter with the new values.
My first idea was to manually change the ConverterParameter in CodeBehind on the PropertyChanged event of my ItemCollection DependencyProperty. But, as I know now, Silverlight has no GetBinding() method.
I heard about GetBindingExpression and tried to do. But MyGrid.GetBindingExpression(Grid.ActualHeightProperty) is always returning null, although the Binding is already established.
So, what can I do to reach my target?