示例#1
0
文件: AutoHideTab.cs 项目: Daoting/dt
        protected override object LoadDlgContent()
        {
            StackPanel sp     = new StackPanel();
            TabHeader  header = new TabHeader();

            header.Owner = this;
            sp.Children.Add(header);
            ContentPresenter content = new ContentPresenter()
            {
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
            };
            Binding contentBinding = new Binding()
            {
                Path = new PropertyPath("SelectedContent"), Source = this
            };

            content.SetBinding(ContentPresenter.ContentProperty, contentBinding);
            sp.Children.Add(content);
            return(sp);
        }