我很新的WPF和XAML和不完全明白怎么做了以下(VS2010,WPF,VB.net):XAML代码布局控件类
我有继承的自定义类从TabItem中,并在这个类中我有我想要在我的标签页上,一个RichTextBox和一个文本框的几个控件。这些TabItems将在运行时动态创建,并随用户需要添加到TabControl。如何创建XAML代码并存储它,以便在运行时动态创建自定义类时,它会根据需要列出两个包含的控件?
Public Class CodePage : Inherits TabItem
Private RTB As RichTextBox
Private TB As TextBox
...
End Class
我在XAML猜测:
<Window x:Class="MainWindow"
xmlns:local="clr-namespace:KRL"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<Style TargetType="{x:Type local:CodePage}">
<Grid>
NEED HELP HERE
</Grid>
</Style>
<Grid>
...
</Grid>
</Window
预先感谢您和抱歉,如果这已被问过,我试过研究和不理解。
嗨肯特,谢谢你的答案。这是什么:代码页你写了什么,即我把什么?我知道,我很新。最后,我如何选择正确的答案?我找不到“正确答案”按钮。谢谢。 – 2011-06-03 16:05:09
请参阅此页(http://msdn.microsoft.com/en-us/library/ms747086.aspx)[http://msdn.microsoft.com/en-us/library/ms747086.aspx]。 – Code0987 2011-06-03 18:16:21