PanelContainerControllerHolder
A convenience class for common PanelContainerView logic to do with creating a PanelContainerController and re-creating it when its dependencies change.
PanelContainerView should use panelContainerViewContext as delegate for PanelContainerView.ttiviPanelContainerViewContext. Dependencies must be set using a delegate returned by rebuildOnChange.
Parameters
Returns the ViewDataBinding containing the PanelContainerView, if any. It is used to optimise the initialization of the PanelContainerController. This function is only called when panelContainerViewContext is set for the first time.
If findContainerViewDataBinding returns a valid ViewDataBinding then the holder listens for binding updates and invokes createController on update completing. That guarantees that a controller is created once when all property updates are completed.
If findContainerViewDataBinding returns a null
then createController is called on every change of observed properties including panelContainerViewContext.
Called when the holder has sufficient information for creating a controller. The returned controller will be bound to the system UI and unbound when the controller is cleared or replaced. The function may return null
when it is not ready to create a controller. In these cases it's common for the information that the controller creation depends on to be set using a delegate returned by rebuildOnChange such that controller creation is automatically re-attempted when then information becomes available.