In the code window is:
public ObservableCollection<ParkingPlace> ParkingPlaces = new ObservableCollection<ParkingPlace>(); public MainWindow() { DataContext = ParkingPlaces; ... in markup:
<StackPanel Visibility="{Binding Count, Converter={StaticResource IntToVisibilityConverter}, Mode=OneWay }"> Converter works correctly. When adding and removing elements, everything happens as it should (the element appears / disappears).
The whole problem begins after deserialization of this collection (reassignment?)
XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection<ParkingPlace>)); using (StreamReader rd = new StreamReader("data.xml")) { ParkingPlaces = (ObservableCollection<ParkingPlace>) xs.Deserialize(rd); } Binding completely stops working. I also tried the NotifyPropertyChanged option, to no avail.
DataContext = ParkingPlaces;? - MaximK