main.qml Example File
bbmprofilebox/assets/main.qml
import bb.cascades 1.0
NavigationPane {
id: navigationPane
onPopTransitionEnded: page.destroy()
Page {
attachedObjects: [
ComponentDefinition {
id: createBoxPage
source: "NewProfileBoxPage.qml"
}
]
actions: [
ActionItem {
title: qsTr("New Profile Box")
onTriggered: {
navigationPane.push(createBoxPage.createObject())
}
},
DeleteActionItem {
onTriggered: {
_profileBoxManager.removeProfileBoxItem(listView.selectedItemId)
}
}
]
Container {
layout: DockLayout {}
background: Color.create("#272727")
ListView {
id: listView
property string selectedItemId
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
dataModel: _profileBoxManager.model
listItemComponents: [
ListItemComponent {
ProfileBoxItem {
}
}
]
onTriggered: {
clearSelection()
select(indexPath)
selectedItemId = dataModel.data(indexPath).id
}
}
}
}
}