<?xml version="1.0" encoding="utf-8"?>
<mx:Application
layout="vertical"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:presentation="togglebuttonbarsample.presentation.*"
xmlns:spicefactory="http://www.spicefactory.org/parsley/flex"
preinitialize="FlexContextBuilder.build(ToggleButtonBarContext)"
xmlns:cairngorm="com.adobe.cairngorm.*"
addedToStage="dispatchEvent( new Event( 'configureIOC', true ) )">
<mx:Script>
<![CDATA[
import com.adobe.cairngorm.navigation.history.IHistory;
import togglebuttonbarsample.ToggleButtonBarContext;
import org.spicefactory.parsley.flex.FlexContextBuilder;
import togglebuttonbarsample.presentation.ContentPM;
[Bindable]
[Inject]
public var model:ContentPM;
[Bindable]
[Inject]
public var history:IHistory;
]]>
</mx:Script>
<cairngorm:CairngormNavigationLib/>
<mx:HBox>
<mx:ToggleButtonBar
dataProvider="{ model.buttonBar }"
selectedIndex="{ model.selectedIndex }"
itemClick="model.navigationBarHandler(event)" />
<mx:Label width="300" text="selectedName: { model.selectedName }" />
<mx:Label text="History:" />
<mx:Button
label="previous" enabled="{ history.hasPrevious }"
click="history.previous()" />
<mx:Button
label="next" enabled="{ history.hasNext }"
click="history.next()" />
</mx:HBox>
<presentation:ContentNavigator
width="100%" height="100%" />
</mx:Application>