您好我想在导航回来时恢复滚动位置,我尝试了以下代码,但我给了我错误。
Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
Dim t As Item = DirectCast(ApplicationData.Current.LocalSettings.Values("scroll"), Item)
FlavorGrid.ScrollIntoView(t)
End Sub
Protected Overrides Sub OnNavigatedFrom(e As NavigationEventArgs)
Dim t As Item = DirectCast(storeData.Collection.LastOrDefault(), Item)
ApplicationData.Current.LocalSettings.Values.Clear()
ApplicationData.Current.LocalSettings.Values.Add("scroll", scrollItem)
End Sub
以下是我得到的错误
1.键入'项目'未定义
2' FlavorGrid'没有宣布。由于其防护等级,它可能无法进入
3.' scrollItem'没有宣布。由于其保护水平,它可能无法进入