我在 Silverlight 5 - VS 2012 工作,遇到了一个有趣的问题。
我有一个有 6 个选项卡的选项卡控件。每个选项卡都需要包含多个控件。但是,每个选项卡只能放置一个控件。这似乎不是一个太大的问题,但我不知道如何将多个控件添加到单个选项卡。
是否有我需要修改的属性设置?任何信息将不胜感激。
先感谢您!埃里克
这是我的 XAML: - 注意:我想使用数据网格向选项卡添加一个按钮。
<sdk:TabControl x:Name="tabMain" HorizontalAlignment="Left" Height="307" Margin="176,452,0,0" VerticalAlignment="Top" Width="817" TabStripPlacement="Left">
<sdk:TabItem Header="Home">
<Grid/>
</sdk:TabItem>
<sdk:TabItem x:Name="tabGatelets" Header="Gatelets" Loaded="tabGatelets_Loaded" GotFocus="tabGatelets_GotFocus">
<sdk:DataGrid x:Name="grdGatelets" HorizontalAlignment="Left" Height="279" VerticalAlignment="Top" Width="700" Margin="12,0,0,0" AlternatingRowBackground="#FFB4CDCD" AutoGenerateColumns="False" ItemsSource="{Binding Gatelets}">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" />
<sdk:DataGridTextColumn Header="URL" Binding="{Binding Path=Url}" />
<sdk:DataGridTextColumn Header="Binding" Binding="{Binding Path=Binding}" />
<sdk:DataGridTextColumn Header="Applications" Binding="{Binding Path=Applications}" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</sdk:TabItem>
<sdk:TabItem Header="Applications">
<Button x:Name="btnApplications" Content="Applications" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Width="89" Margin="357,51,0,0"/>
</sdk:TabItem>
<sdk:TabItem Header="Auditing">
<Button x:Name="btnAudits" Content="Audits" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Width="69" Margin="197,133,0,0"/>
</sdk:TabItem>
<sdk:TabItem Header="Tracing">
<Button x:Name="btnTracing" Content="Tracing" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="92" Margin="193,256,0,0"/>
</sdk:TabItem>
<sdk:TabItem Header="About">
<TextBlock HorizontalAlignment="Left" Height="295" TextWrapping="Wrap" Text="This is where we put stuff about the application." VerticalAlignment="Top" Width="486"/>
</sdk:TabItem>
</sdk:TabControl>