I created a program that stores any number of objects of my type Project. Each project then contains any number of Files, which is another object that I created for this program.
The problem that I am experiencing in XAML is in two areas, but in my opinion has a similar origin.
I have a window that contains a ListView populated with files in the selected project. From here I can check the box next to each to turn them on or off, and if I select a file, information about it will appear in the status bar of this window.
If I turn off the file, its text color should look light gray in the ListView, but it does not do it automatically; I need to close the window and open it again. The file implements INotifyPropertyChanged and fires this event if the on / off state changes.
I use this XAML code, where the converter is in my code behind the class:
<ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Foreground" Value="{Binding Path=IsVisible, Converter={StaticResource VisibleStateToFontColourConverter}}"/> </Style> </ListBox.ItemContainerStyle>
Also for the selected file, if the information in the file changes during its selection (which other classes may occur), I want the status bar to be automatically updated to reflect this change, but it is not; I have to click something else and then reselect the file of interest. I implement and use INotifyPropertyChanged for this too, so I donβt know why it is not updated automatically. My XAML code for the status element is as follows:
<StatusBarItem Name="statusItem_FileInfo" Content="{Binding ElementName=loadedFiles_ListView, Path=SelectedItem, Converter={StaticResource GIS_FileToInfoConverter}}"/>
Does anyone know what I am missing, what will bring it all together?