async void RootPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "DetailItem") { var detail = App.RootViewModel.DetailItem; if (detail == null) { return; } NavigationService.Navigate(new Uri("/DetailsPage.xaml" + (detail.IsNew ? "?" + Guid.NewGuid() : null), UriKind.Relative)); MainLongListSelector.SelectedItem = null; } else if (e.PropertyName == "Items") { foreach (var item in App.RootViewModel.Items) { if (item.Date > DateTime.Now.Subtract(new TimeSpan(1, 0, 0, 0))) { Thread.Sleep(1); MainLongListSelector.ScrollTo(item); break; } } } }
// Закладка private void AppMarker_Click(object sender, EventArgs e) { // Демо версия if (App.isTrial) { MessageBox.Show("Данная функция доступна в полной версии приложения.", "Быстрый переход к закладке", MessageBoxButton.OK); } else { MainLongListSelector.ScrollTo(MainLongListSelector.ItemsSource[(int)AppHelper.Storage["LastItem"]]); } }