WPF User control and updating binding
I've got a user control that has next and prev buttons. Clicking "next" sets a IsLoading = true, makes a request to get an image, and once complete sets IsLoading = false. IsLoading is bound to the IsEnabled property.
The user control also has an index, and Next increases the index, up until it hits it's maximum index. I'd like the IsEnabled property to be bound such that IsDisabled = IsLoading Index == MaxIndex.
I know I can introduce a new boolean, IsNextDisabled => IsLoading Index == MaxIndex.
IsLoading is a depedency property (lives in teh code behind) and so is Index. I guess I'd have to make IsNextDisabled also an dep prop and somehow NotifyPropertyChanged on that?
Note that I am not using a viewmodel, this is all code behind at the moment. I don't like how I have to create dp to bind the code behind to the xaml
0 Replies