/// <summary> /// 初始化信息 /// </summary> protected override void InitBaseInfo() { ///设置初始宽度 this.Width = 80; ///设置自己的Panel MyPanel = new StackPanel(); ///设置为垂直布局 MyPanel.Orientation = Orientation.Vertical; ///设定布局流向 if (Position == PositonType.Left) { MyPanel.FlowDirection = FlowDirection.LeftToRight; } else { MyPanel.FlowDirection = FlowDirection.RightToLeft; } ///加入控件作为主布局 GetChildren().Add(MyPanel); ///绑定高度 ToolHelp.SetBindingHeight(MyPanel, this); ///绑定宽度 ToolHelp.SetBindingWidth(MyPanel, this); }