private void searchBtn_Click(object sender, RoutedEventArgs e) { //ZhName.Text = AccessHelper.GetSearchGameZhName(searchText.Text); gameIndex = AccessHelper.GetSearchGameIndex(searchText.Text); UpdateWindow(); }
private void searchBtn_Click(object sender, RoutedEventArgs e) { // 获取要定位之前 ScrollViewer 目前的滚动位置 //var currentScrollPosition = ScrollViewer.VerticalOffset; //var point = new Point(0, currentScrollPosition); //// 计算出目标位置并滚动 //var targetPosition = TargetControl.TransformToVisual(ScrollViewer).Transform(point); //ScrollViewer.ScrollToVerticalOffset(targetPosition.Y); //Canvas canvas = UIFindHelper.GetChildObject<Canvas>(list, "canvas9"); int index = AccessHelper.GetSearchGameIndex(searchText.Text); scrollviewer1.ScrollToVerticalOffset(200 * index); }