gpt4 book ai didi

listview - XAML : Using Semantic Zoom and ListView MakeVisible doesn't scroll

转载 作者:行者123 更新时间:2023-12-02 03:54:10 26 4
gpt4 key购买 nike

我在语义缩放控件中嵌入了一个 ListView 控件:

<SemanticZoom x:Name="diarySemanticZoom" Grid.Row="1">
<SemanticZoom.ZoomedOutView>
<GridView>
...
</GridView>
</SemanticZoom.ZoomedOutView>
<SemanticZoom.ZoomedInView>
<ListView
x:Name="diaryListView"
AutomationProperties.AutomationId="diaryListView"
AutomationProperties.Name="Grouped Items"
Grid.Row="1"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
SelectionMode="Single"
ScrollViewer.IsHorizontalScrollChainingEnabled="False"
ScrollViewer.IsVerticalScrollChainingEnabled="False"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical"
MaximumRowsOrColumns="1" x:Name="insideWrapGrid"/>
</ItemsPanelTemplate> ...

当 XAML 加载时,我想滚动到 Listview 中的一个项目

protected override void LoadState(Object navigationParameter, 
Dictionary<String, Object> pageState)
{
var diaryDaysModel = DiaryDays.DiaryDayList;
/* Group the days */
var daysViewModelGroup = from ddm in diaryDaysModel
group ddm by new { ddm.MonthName, ddm.DayNo } into grp
orderby grp.Key.DayNo
select new { Key = grp.Key, Items = grp };

itemsViewSource.Source = daysViewModelGroup;
diaryListView.SelectedIndex = 5;
var zoomLoc = new SemanticZoomLocation() { Item = diaryListView.SelectedItem };
diarySemanticZoom.ZoomedInView.MakeVisible(zoomLoc);
diaryListView.MakeVisible(zoomLoc);

}

到目前为止,我已经尝试了很多选项,但似乎没有一个可以移动滚动条

最佳答案

您应该可以滚动。如果您想垂直滚动,请编辑 ScrollViewer.IsVerticalScrollBarEnabled="Enabled"。

关于listview - XAML : Using Semantic Zoom and ListView MakeVisible doesn't scroll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13394028/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com