1
我有字符串數組。它看起來是這樣的:如何在全景物品中動態創建按鈕?
我有一個空的全景:
<controls:Panorama x:Name="MainPanorama">
</controls:Panorama>
我想動態,用我的陣列,創建全景頁面全景物品, 它應該是這樣的:
<controls:Panorama x:Name="MainPanorama">
<controls:PanoramaItem Header="first">
<ScrollViewer>
<StackPanel>
<Button Name="button1" content="create"/>
<Button Name="button2" content="save"/>
<Button Name="button3" content="open"/>
</StackPanel>
</ScrollViewer>
</controls:PanoramaItem>
<controls:PanoramaItem Header="second">
<ScrollViewer>
<StackPanel>
<Button Name="button4" content="save as"/>
<Button Name="button5" content="import"/>
</StackPanel>
</ScrollViewer>
</controls:PanoramaItem>
</controls:Panorama>
所以,問題是:如何在全景項目中動態創建按鈕?按鈕必須有不同的名稱。我在這裏展示的數組不是實際的數組。在我的工作中,我有另一個更大的,但我認爲這足以理解這個問題。