0
我有一个项目控件,它允许用户拖动和重新调整其中的项目。项目可能会被拖出可视区域,在这种情况下,我想显示相应的滚动条。自动滚动面板
这里的XAML
的部分<ControlTemplate x:Key="ItemsControlTemplate" TargetType ="ItemsControl">
<ScrollViewer HorizontalScrollBarVisibility="Auto">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
<ItemsControl ItemsSource="{Binding Path=Models}"
Margin="10,10,10,10"
Grid.Row="1"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Template="{StaticResource ItemsControlTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas ClipToBounds="True"
SnapsToDevicePixels="True"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Height="400" Width="600"
Canvas.Left="50" Canvas.Top="150"
Template="{StaticResource DesignerItemTemplate}"
Margin="10,10,10,10">
<Views:ChartView />
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
的XAML显示了吧,但是当一个项目拖出视杆未启用。
感谢您的回复。我已经计算出如何在需要时显示它们 – 2012-04-18 14:40:44