2016-06-13 91 views

回答

0

你可以爲ListView創建一個ItemTemplate,但你的例子顯然是一個Grid,所以我會用它來代替。

<Grid> 
    <Grid.RowDefinitions> 
    <RowDefinition Height="33*" /> 
    <RowDefinition Height="33*" /> 
    <RowDefinition Height="33*" /> 
    </Grid.RowDefinitions> 
    <Grid.ColumnDefinitions> 
    <ColumnDefinition Width="50*" /> 
    <ColumnDefinition Width="50*" /> 
    </Grid.ColumnDefinitions> 
    <Button Text="Order Proposal" Grid.Row="0" Grid.Column="0" /> 
    ... additional buttons here ... 
</Grid> 

你可能會想創建,而不是使用按鈕,或使用建立您想每個單元的自定義UI一個內容查看自定義控制。

0
<ListView> 
    <ListView.ItemTemplate> 
    <DataTemplate> 
     <ViewCell> 
     <Grid> 
      <!-- Your item template UI --> 
     </Grid> 
     </ViewCell> 
    </DataTemplate> 
    </ListView.ItemTemplate> 
</ListView> 

但對我來說更好的辦法是使用GridView控件: XLabs GridView on github

相關問題