private void SearchBoxUnicode_OnTextChanged(object sender, TextChangedEventArgs e) { var unicodeIndex = SearchBoxUnicode.Text.Trim(); int intIndex = Utils.ParseHexString(unicodeIndex); var ch = ViewModel.Chars.FirstOrDefault(c => c.UnicodeIndex == intIndex); if (null != ch) { CharGrid.SelectedItem = ch; CharGrid.ScrollIntoView(ch); } }
private void MainPage_Loaded(object sender, RoutedEventArgs e) { _coreTitleBar.LayoutMetricsChanged += OnLayoutMetricsChanged; Window.Current.SizeChanged += OnWindowSizeChanged; UpdateLayoutMetrics(); if (null != LstFontFamily.SelectedItem) { LstFontFamily.ScrollIntoView(LstFontFamily.SelectedItem, ScrollIntoViewAlignment.Leading); if (null != CharGrid.SelectedItem) { CharGrid.ScrollIntoView(CharGrid.SelectedItem, ScrollIntoViewAlignment.Leading); } } }