我需要將經典的ListView移植到WPF版本,我搜索了很多,但是我找不到一個簡單的代碼片段。我需要的只是模擬LargeImageList來顯示動態/網絡攝像頭捕捉(圖像)圖片。LargeImages to WPF ListView port
.NET 3.5
我需要將經典的ListView移植到WPF版本,我搜索了很多,但是我找不到一個簡單的代碼片段。我需要的只是模擬LargeImageList來顯示動態/網絡攝像頭捕捉(圖像)圖片。LargeImages to WPF ListView port
.NET 3.5
然後,只需使用的StackPanel
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Border Margin="5" CornerRadius="5" Height="40" Width ="45" >
<Image Source="Images/Desert.jpg"></Image>
</Border>
<Border Margin="5" CornerRadius="5" Height="40" Width ="45" >
<Image Source="Images/Desert.jpg"></Image>
</Border>
<Border Margin="5" CornerRadius="5" Height="40" Width ="45" >
<Image Source="Images/Desert.jpg"></Image>
</Border>
</StackPanel>
其實你想用的是一個包裹面板:
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
...
</ListView>
此外,如果你的圖片AREN你已經可以使用本文所寫的技巧製作相同的尺寸他們所有的大小相同: http://joshsmithonwpf.wordpress.com/2008/09/06/synchronizing-the-width-of-elements-in-an-itemscontrol/
請看到我的編輯 – Stecya 2011-05-12 14:25:57
我需要programmaticaly填充圖片... – 2011-05-12 15:21:20
您可以在運行時 – Stecya 2011-05-12 15:25:34