handleBackgroundModeChanged method
Handles the background mode change event.
This method calls the onBackgroundModeChanged callback with the provided newMode
and then calls handleUpdateUI.
Implementation
void handleBackgroundModeChanged(LayerBackgroundMode newMode) {
onBackgroundModeChanged?.call(newMode);
handleUpdateUI();
}