【发布时间】:2023-03-10 17:30:01
【问题描述】:
目前我在一个大型软件项目中进行协作,但我在尝试实现一个不错的功能时遇到了问题。
问题是,我不知道如何自动滚动到某个用户可以选择的特定项目。包装面板用作项目控件中的项目面板模板。
为了更好的理解,代码如下:
<ItemsControl ItemsSource="{Binding SomeData}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<SomeChart DataContext="{Binding }" Focusable="True" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
【问题讨论】:
-
抱歉我的错误解释我的问题不是我无法设置焦点。我的问题是自动滚动到所选项目以便显示。列表比显示的要长,此时您必须手动滚动。