private void UnpackContent() { // creating children List <FieldList> children = Content.GetItems <FieldList>(NaviAgentFieldID.BlockData); for (int i = 0; i < children.Count; i++) { int childDefinitionID = children[i][MessageOutFieldID.DefinitionID].AsInteger() ?? 0; DefinitionBase definition = Core.Definitions.Find(ParentNode.ApplicationID, childDefinitionID, true); if ((definition != null) && (definition is BlockDefinition)) { BlockBase newBlock = Core.UIFactory.CreateAndInitialiseBlock(Host, ParentNode, this, definition as BlockDefinition, children[i], false); if (newBlock != null) { AtomicBlock newAtomic = newBlock as AtomicBlock; AtomicBlockDefinition newDefinition = definition as AtomicBlockDefinition; if ((newAtomic != null) && (newDefinition != null)) { if (newDefinition.HintedType == UIHintedType.ActionSheetTitle) { titleBlock = newAtomic; } else { actionBlocks.Add(newAtomic); } } } } } }
private void UnpackContent() { // creating children List <FieldList> children = Content.GetItems <FieldList>(NaviAgentFieldID.BlockData); AtomicBlock title = null; List <AtomicBlock> itemTitles = new List <AtomicBlock>(); List <FrameBlock> items = new List <FrameBlock>(); for (int i = 0; i < children.Count; i++) { int childDefinitionID = children[i][MessageOutFieldID.DefinitionID].AsInteger() ?? 0; DefinitionBase definition = Core.Definitions.Find(ParentNode.ApplicationID, childDefinitionID, true); if ((definition != null) && (definition is BlockDefinition)) { BlockBase newBlock = Core.UIFactory.CreateAndInitialiseBlock(Host, ParentNode, this, definition as BlockDefinition, children[i], false); if (newBlock != null) { if (newBlock is AtomicBlock) { if (((BlockDefinition)definition).HintedType == UIHintedType.PanoramaTitle) { title = (AtomicBlock)newBlock; } else { itemTitles.Add((AtomicBlock)newBlock); } } else if (newBlock is FrameBlock) { items.Add((FrameBlock)newBlock); } } } } if ((title != null) && !String.IsNullOrWhiteSpace(title.Caption) && (itemTitles.Count > 0) && (items.Count > 0) && (itemTitles.Count == items.Count)) { panorama = new Panorama(); panorama.Title = title.Caption; for (int i = 0; i < items.Count; i++) { PanoramaItem item = new PanoramaItem(); item.Header = !String.IsNullOrWhiteSpace(itemTitles[i].Caption) ? itemTitles[i].Caption : WaveConstant.UnknownText; item.Content = items[i]; panorama.Items.Add(item); } if ((ContainerDefinition != null) && ContainerDefinition.Background.HasValue) { PaintStyleResult bgRes = ResolvePaintStyle(ContainerDefinition.Background.Value); if (bgRes.Brush != null) { panorama.Background = bgRes.Brush; } } Children.Add(panorama); for (int i = 0; i < items.Count; i++) { WaveChildren.Add(items[i]); } } }
private void UnpackContent() { // parse settings if (Data != null) { loadOnDemand = Data.RenderingHints[RenderingHintKey.OnDemand].Equals(WaveConstant.True, StringComparison.InvariantCultureIgnoreCase); } // creating children List <FieldList> children = Content.GetItems <FieldList>(NaviAgentFieldID.BlockData); AtomicBlock title = null; List <AtomicBlock> itemTitles = new List <AtomicBlock>(); List <FrameBlock> items = new List <FrameBlock>(); for (int i = 0; i < children.Count; i++) { int childDefinitionID = children[i][MessageOutFieldID.DefinitionID].AsInteger() ?? 0; BlockDefinition definition = Core.Definitions.Find(ParentNode.ApplicationID, childDefinitionID, true) as BlockDefinition; if (definition != null) { if (definition is FrameDefinition) { items.Add(new FrameBlock(Host, ParentNode, this, definition as FrameDefinition, children[i], false, !loadOnDemand)); } else { AtomicBlock newBlock = Core.UIFactory.CreateAndInitialiseBlock(Host, ParentNode, this, definition, children[i], false) as AtomicBlock; if (newBlock != null) { if (definition.HintedType == UIHintedType.PivotTitle) { title = newBlock; } else { itemTitles.Add(newBlock); } } } } } if ((title != null) && !String.IsNullOrWhiteSpace(title.Caption) && (itemTitles.Count > 0) && (items.Count > 0) && (itemTitles.Count == items.Count)) { pivot = new Pivot(); pivot.Title = title.Caption; pivot.LoadingPivotItem += new EventHandler <PivotItemEventArgs>(pivot_LoadingPivotItem); for (int i = 0; i < items.Count; i++) { PivotItem item = new PivotItem(); item.Header = !String.IsNullOrWhiteSpace(itemTitles[i].Caption) ? itemTitles[i].Caption : WaveConstant.UnknownText; item.Content = items[i]; pivot.Items.Add(item); } if ((ContainerDefinition != null) && ContainerDefinition.Background.HasValue) { PaintStyleResult bgRes = ResolvePaintStyle(ContainerDefinition.Background.Value); if (bgRes.Brush != null) { pivot.Background = bgRes.Brush; } } Children.Add(pivot); for (int i = 0; i < items.Count; i++) { WaveChildren.Add(items[i]); } } }