Encapsulates the management of data provider for Data-Driven Exclusive Activity Host. More...
#include <kanzi/ui/node/concept/activity/activity_source_controller.hpp>
Public Member Functions | |
ActivitySourceController (DataDrivenExclusiveActivityHostConcept &node) | |
Constructor. More... | |
DataContextSharedPtr | getActivityData (int index) |
Gets Activity data for index. More... | |
size_t | getCount () const |
Gets the number of objects known by the activity source controller in the given activity list source. More... | |
void | onActivitySourceDisabled () |
Disables the internal Activity source list. More... | |
~ActivitySourceController () | |
Destructor. More... | |
Encapsulates the management of data provider for Data-Driven Exclusive Activity Host.
This is a helper class for Data-Driven Exclusive Activity Host classes.
|
explicit |
Constructor.
node | An Activity node for which to create the data provider. |
kanzi::ActivitySourceController::~ActivitySourceController | ( | ) |
Destructor.
DataContextSharedPtr kanzi::ActivitySourceController::getActivityData | ( | int | index | ) |
Gets Activity data for index.
index | Index of item for which data is requested. |
size_t kanzi::ActivitySourceController::getCount | ( | ) | const |
Gets the number of objects known by the activity source controller in the given activity list source.
You can calculate the last index as ('count' - 1).
void kanzi::ActivitySourceController::onActivitySourceDisabled | ( | ) |
Disables the internal Activity source list.
This method must be called when the ActivitySourceProperty is removed from the Data-Driven Exclusive Activity Host. ActivitySourceController observes the changes in the ActivitySourceProperty with an internal binding. This binding does not get a notification when the ActivitySourceProperty is removed from the Data-Driven Exclusive Activity Host, hence this method is needed to notify the Data-Driven Exclusive Activity Host. Setting or reattaching the ActivitySourceProperty notifies the ActivitySourceController, eventually updating the Activity source.