Binding to ObservableCollection for Visibility. What is wrong with this XAML or ?
Hi,
If you could help that would be great!
The XAML line with visibility for the chart is as follows
<chartingToolkit:Chart Visibility="{Binding BrightnessValueList, Converter={StaticResource nonEmptyCollectionToVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}" Height="218" Margin="0,0,20,127" x:Name="columnChart" Title="Star Brightness" VerticalAlignment="Bottom" Grid.Column="2">
My converter is called once when the application starts up and then not again. The converter is doing its job. I just need it called when items are added to the ObservableCollection :
this.BrightnessValueList.Add(new KeyValuePair<string, double>(focuserMotorStepPosition.ToString("00000"), starMaxBrightness));
BrightnessValueList is defined as follows:
public ObservableCollection<KeyValuePair<string, double>> BrightnessValueList {get; set; }
If more information is needed, just let me know. I thought the PropertyChanged was supposed to be raised with the converter being called when the "Count" property of the ObservableCollection changes (i.e. when adding an item in my case).
Bookmarks