0
我有一個Grid
與一些Image
s。在WPF中創建網格/ WrapPanel或其他UIElement的縮略圖
我想製作另一個Grid
,這將是此Grid
'只有更小'的副本。我想每Image
我會加到第一個Grid
會加到另一個Grid
。
如果有人可以幫助我。
我有一個Grid
與一些Image
s。在WPF中創建網格/ WrapPanel或其他UIElement的縮略圖
我想製作另一個Grid
,這將是此Grid
'只有更小'的副本。我想每Image
我會加到第一個Grid
會加到另一個Grid
。
如果有人可以幫助我。
如果你使用MVVM,你有一個綁定驅動第一個網格的內容。將第二個網格重新綁定到相同的數據成員,並且即使對該集合執行編輯之後,它也會更新以顯示相同的內容。
使用VisualBrush
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UniformGrid Rows="1">
<StackPanel Name="Original" Width="100" Height="100">
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
<TextBlock Text="Pretend I'm a list of images"/>
</StackPanel>
<Rectangle Name="Thumbnail" Width="50" Height="50">
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=Original}"/>
</Rectangle.Fill>
</Rectangle>
</UniformGrid>
</Page>
如何巴比形成的呢? – Will