protected override void OnInitialized() { if (Parent != null && Parent.Bars != null) { Index = Parent.BarList.Count; Parent.AddBar(this); } }