import xp.system.Style; import xp.system.Font; import xp.system.Brush; import xp.system.Thickness; import xp.controls.DockPanel; class DetailsPanel extends DockPanel{ static var classInfo:Object={superclass:DockPanel,version:"1.0.0.000",symbolId:"DetailsPanel"} public function getClass(){return DetailsPanel} public var img; public var lblCatalog; public var lblAsin; public var lblListPrice; public var lblOurPrice; public var lblAvailability; public var lblLink///; public var lblCaption; private function initStyles(){ super.initStyles(); margin=new Thickness(0,5,0,5); borderBrush=new Brush(0x999999); borderThickness=new Thickness(2); padding=new Thickness(2); //since we are using 14pt everywhere create a local copy of the Lable style and change the font to 14 var lbl = resources.Label = Style.cloneStyle(resources.Label); lbl.fontSize=14;lbl.fontName="_sans"; //make me some styles//1 a Bold style for labels//2 a Bold Green for the OurPrice label //3 a standard Green for the OurPrice value//4 a caption label var styleLB=resources.LabelBold=Style.cloneStyle(lbl); var styleLBG=resources.LabelBoldGreen=Style.cloneStyle(lbl); var styleLG=resources.LabelGreen=Style.cloneStyle(lbl); var styleLBC=resources.LabelBoldCaption=Style.cloneStyle(lbl); styleLB.fontBold=styleLBG.fontBold=styleLBC.fontBold=true; styleLG.fontColor=styleLBG.fontColor=0x009900; styleLBC.fontColor=0xFFFFFF; styleLBC.fontSize=18; } private function containerOnLoad(){ //and then create the bindings lblCatalog.addDataBinding({path:"Catalog"}); lblAsin.addDataBinding({path:"Asin"}); lblListPrice.addDataBinding({path:"ListPrice"}); lblOurPrice.addDataBinding({path:"OurPrice"}); lblAvailability.addDataBinding({path:"Availability"}); img.addDataBinding({path:"ImageUrlMedium"}); lblCaption.addDataBinding({path:"ProductName"}); lblCaption.background=new Brush(0x777777); lblLink.text="Click Here to Go To This Item"; lblLink.addDataBinding({property:"url", path:"@url"}); img.borderBrush=null; img.padding=new Thickness(5) } }