main.qml Example File
messages/assets/main.qml
import bb.cascades 1.0
NavigationPane {
id: navigationPane
onPopTransitionEnded: page.destroy()
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
bottomPadding: 30
DropDown {
id: accounts
title: "Account"
onSelectedOptionChanged: _messages.setSelectedAccount(selectedOption)
}
TextField {
hintText: qsTr ("Filter by...")
onTextChanging: _messages.filter = text
}
ListView {
dataModel: _messages.model
listItemComponents: ListItemComponent {
type: "item"
StandardListItem {
title: ListItemData.subject
description: ListItemData.time
}
}
onTriggered: {
clearSelection()
select(indexPath)
_messages.setCurrentMessage(indexPath)
_messages.viewMessage();
navigationPane.push(messageViewer.createObject())
}
}
}
}
actions: [
ActionItem {
title: qsTr ("New")
imageSource: "asset:///images/action_composemessage.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
_messages.composeMessage()
navigationPane.push(messageComposer.createObject())
}
}
]
}
attachedObjects: [
ComponentDefinition {
id: messageComposer
source: "MessageComposer.qml"
},
ComponentDefinition {
id: messageViewer
source: "MessageViewer.qml"
},
RenderFence {
raised: true
onReached: {
_messages.addAccounts(accounts)
}
}
]
}