internal void OpenBookmarkListPage() { if (menuCarouselPage == null) { return; } if (menuCarouselPage.Children.Count == 1) { menuCarouselPage.Children.Add(new BookmarkListView(this)); } BookmarkListView bookmarkListPage = menuCarouselPage.Children[1] as BookmarkListView; if (bookmarkListPage == null) { return; } BookmarkListViewModel vmBookmarkList = bookmarkListPage.BindingContext as BookmarkListViewModel; if (vmBookmarkList == null) { return; } menuCarouselPage.IsBusy = true; vmBookmarkList.ListAllBookMarks(); menuCarouselPage.IsBusy = false; menuCarouselPage.CurrentPage = menuCarouselPage.Children[1]; }
private void GetListBookmarksCompleted(object sender, CompleteBookmarksEvent e) { bookmarks.bookmarksListCompleted -= GetListBookmarksCompleted; if (e.BookmarkList != null) { if (e.BookmarkList.Count > 0) { // Show window with the possible layers bookmarkListView = new BookmarkListView(); BookmarkListViewModel listViewModel = new BookmarkListViewModel(e.BookmarkList); modalDialogService.ShowDialog(bookmarkListView, listViewModel, EndOfBookmarkSelection); } else { ShowMessagebox.Raise(new Notification { Content = Silverlight.UI.Esri.JTToolbarCommon.Resources.ToolbarCommon.NoBookmarksAvailable, Title = Silverlight.UI.Esri.JTToolbarCommon.Resources.ToolbarCommon.Warning }); } } else { // Error occurred ShowErrorMessagebox.Raise(new Notification { Content = String.Format("GetListBookmarksCompleted-{0}[{1}]", e.ErrorMessage, ""), Title = "System error" }); } }
private void EndOfBookmarkSelection(BookmarkListViewModel listViewModel) { if (bookmarkListView.DialogResult.HasValue && bookmarkListView.DialogResult.Value) { BookmarkElement bookmark = listViewModel.BookmarkSelected; if (bookmark != null) { // Zoom to the extent Envelope extent = bookmark.Extent.ToEnvelope(); gisOperations.ZoomTo(extent); } } bookmarkListView = null; }