I have the Following Collection: ObservableCollection<CheckedFileObject> Files
A CheckedFileObject contains a FileObject and a bool isChecked. Now when a user selects a File the isChecked Value of this file gets changed to true.
If at least one CheckedFileObject contains IsChecked = true, i want to make the Delete Button Visible.
So my Question is, is it possible to toggle the visibility based on an item in an ObservableCollection and how? I doesn't matter how many items there are, but if one is checked the button should be visible.
Maybe something like:
Visibility="{Binding Files[i].IsChecked, Mode=OneWay, Converter={StaticResource BooleanAndToVisibilityConverter}}"
Or perhaps binding the ObservablCollection to a bool in the viewmodel which gets updated through something like this:
var isVisible = Files.Any(x => x.IsChecked == true);
when the collection changes. Is this even possible?