0
我想讓右邊的ListBox的選定項目看起來像左側的ListView(帶有GridView)的選定項目。如何將ListBox的選定項目樣式化爲ListView的選定項目(使用GridView)?
alt text http://img695.imageshack.us/img695/8427/xamlpad.png
這是XAML代碼:
<Grid>
<StackPanel Orientation="Horizontal" >
<ListView Margin="4" Width="200" >
<ListView.View>
<GridView>
<GridViewColumn Header="Site" />
</GridView>
</ListView.View>
<ListViewItem>Server Fault</ListViewItem>
<ListViewItem>Stack Overflow</ListViewItem>
<ListViewItem>Super User</ListViewItem>
</ListView>
<ListBox Margin="4" Width="200">
<ListBoxItem>Server Fault</ListBoxItem>
<ListBoxItem>Stack Overflow</ListBoxItem>
<ListBoxItem>Super User</ListBoxItem>
</ListBox>
<Button Margin="4" Content="OK" Width="80" Height="20" />
</StackPanel>
</Grid>
謝謝,這是一個很好的起點。 – ggponti 2010-02-04 18:20:44