将项目放在项目控件中的路径上

时间:2013-09-16 07:06:03

标签: wpf xaml

您好我正在使用WPF应用程序,我需要将项目放在面板上的U形路径上

所以我使用以下代码,但它将项目放在队列中,因为我使用了堆栈面板。那么有没有办法将项目放在预定义的路径上,因为我一直在向数据源添加元素,它们应放在预定义的路径上。

<ItemsControl Name="icTodoList" Grid.Row="2"  ItemsSource="{Binding DocumentsItemsSource}"  Width="100" Height="460" >
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Orientation="Vertical"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button Margin="0" HorizontalAlignment="Center" DataContext="{Binding}" Content="{Binding Path=ItemName}" Height="35" Width="35" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

0 个答案:

没有答案
相关问题