我正在使用Silverlight 5 - VS 2012,並遇到了一個有趣的問題。Silverlight選項卡控件 - 一個選項卡上的多個控件
我有一個選項卡控件有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>
添加多個控件時,在xaml編輯器中是否出現某種錯誤? – Stainedart 2013-03-27 15:26:13
呃...通過XAML添加控件給了我內容屬性已經設置的錯誤。 – 2013-03-27 15:33:41