public ArrayGraphics(AbstractCollection container) : base() { panel = new WrapPanel(); size = 0; this.Opacity = 1.0; Initialize(container); container.Changed += container_Changed; //container.IteratorCreated += new EventHandler<IteratorCreatedEventArgs>(container_IteratorCreated); container.Indexed += ArrayGraphics_Indexed; //if (container is IIndexable) //{ // (container as ArrayWrapper).IndexChanged += new IndexChangedEventHandler(ArrayGraphics_IndexChanged); //} }
protected void Initialize(AbstractCollection container) { ClearPanel(); this.container = container; size = container.Count; CreateElements(container); Content = panel; }
protected void CreateElements(AbstractCollection container) { graphics = new BorderedGraphics[size]; IEnumerator<VapeTeam.Psimulex.Core.Types.BaseType> it = container.AsEnumerable().GetEnumerator(); int i = 0; while (it.MoveNext()) { BorderedGraphics elem = graphics[i] = new BorderedGraphics( GraphicsElementFactory.Produce(it.Current)); elem.ParentGraphics = this; elem.HorizontalAlignment = HorizontalAlignment.Stretch; elem.VerticalAlignment = VerticalAlignment.Stretch; elem.InitializeDraw(); panel.Children.Add(elem); ++i; } }