WPF ListBox w/ Header Button IsEnabled Question
I have a ListBox that displays items in need of approval, the ListBox.ItemTemplate is set to a viewmodel displaying the item's view in the list and each has an individual approve button.
I also have set the GroupStyle.HeaderTemplate to include an 'approve all' button, which I have working by using a behavior that uses the datacontext of the button (CollectionViewGroup) to send an event indicating which of the items should be approved.
My items require being updated from several databases before they are ready for approval, which happens asynchronously and their individual approve buttons enable once they are in a state where approval is valid.
My question is, how would I go about implementing disabling the 'approve all' button in the ListBox HeaderTemplate while the items in the CollectionViewGroup are awaiting their background updates.
I've been able to check them manually at the time of click not perform the action if they aren't all in the proper state but I'd like the UI to indicate they cannot be 'all approved' until the items have all updated to the proper state.
I also have set the GroupStyle.HeaderTemplate to include an 'approve all' button, which I have working by using a behavior that uses the datacontext of the button (CollectionViewGroup) to send an event indicating which of the items should be approved.
My items require being updated from several databases before they are ready for approval, which happens asynchronously and their individual approve buttons enable once they are in a state where approval is valid.
My question is, how would I go about implementing disabling the 'approve all' button in the ListBox HeaderTemplate while the items in the CollectionViewGroup are awaiting their background updates.
I've been able to check them manually at the time of click not perform the action if they aren't all in the proper state but I'd like the UI to indicate they cannot be 'all approved' until the items have all updated to the proper state.