private async void OnTopItemTapped(object sender, TappedRoutedEventArgs e) { var listView = sender as ListView; var pagePic = listView.SelectedItem as PagePicture; await LibraryView.LoadBottomGrid(mlPic, pagePic.Series, imageGroups); await LibraryView.LoadNewPicture(mlPic, pagePic.Series, pagePic.SeriesNumberTag, mainImage); }
private async void MainPage_OnPictureChanged(object sender, OnPictureChangedArgs e) { var selTop = imageHeads.SelectedIndex; if (selTop < 0) { selTop = 0; } var selItem = imageHeads.Items[selTop] as PagePicture; if (!selItem.Series.Equals(e.File.Series)) {//move next, previous foreach (var item in imageHeads.Items) { var pagePic = item as PagePicture; if (pagePic.Series.Equals(e.File.Series)) { imageHeads.SelectedItem = item; imageHeads.ScrollIntoView(item); await LibraryView.LoadBottomGrid(mlPic, pagePic.Series, imageGroups); if (!e.FileType.Equals("grid")) { await LibraryView.LoadNewPicture(mlPic, pagePic.Series, pagePic.SeriesNumberTag, mainImage); } return; } } } var selBottom = imageGroups.SelectedIndex; if (selBottom < 0) { selBottom = 0; } selItem = imageGroups.Items[selBottom] as PagePicture; if (!selItem.Series.Equals(e.File.Series) || !selItem.SeriesNumberTag.Equals(e.File.SeriesNumberTag)) {//move next, previous foreach (var item in imageGroups.Items) { var pagePic = item as PagePicture; if (pagePic.Series.Equals(e.File.Series) && pagePic.SeriesNumberTag.Equals(e.File.SeriesNumberTag)) { imageGroups.SelectedItem = item; imageGroups.ScrollIntoView(item); if (!e.FileType.Equals("grid")) { await LibraryView.LoadNewPicture(mlPic, pagePic.Series, pagePic.SeriesNumberTag, mainImage); } } } } }
private async Task OpenPicturesFolder() { mlPic = await LibraryView.FolderOpenLoad(); if (mlPic.Files.Count() == 0) { return; } var pagePic = mlPic.First().First; await LibraryView.LoadTopGrid(mlPic, imageHeads); await LibraryView.LoadBottomGrid(mlPic, pagePic.Series, imageGroups); await LibraryView.LoadNewPicture(mlPic, pagePic.Series, pagePic.SeriesNumberTag, mainImage); }