diff --git a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml
index d87dc2805..0ac38ae35 100644
--- a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml
+++ b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml
@@ -70,8 +70,8 @@
-
-
+
diff --git a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs
index 1a6137a9a..6f4dd9364 100644
--- a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs
+++ b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs
@@ -12,7 +12,7 @@ public partial class BookmarksViewSample : ContentPage
private const string webMapOneUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=e50fafe008ac4ce4ad2236de7fd149c3";
private const string webMapTwoUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=16f1b8ba37b44dc3884afc8d5f454dd2";
private const string webSceneOne = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=6b6588041965408e84ba319e12d9d7ad";
- private const string webSceneTwo = "https://www.arcgis.com/home/webscene/viewer.html?webscene=b9ad8372ff884bc4a4e78d936b170f7d";
+ private const string webSceneTwo = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=b3e2230e170d4f91aa3d47f88821743d";
private MapView MyMapView;
private SceneView MySceneView;
private Random _randomizer = new Random();
@@ -48,6 +48,8 @@ private void SetMapViewBinding_Click(object? sender, EventArgs e)
BookmarksView.SetBinding(Esri.ArcGISRuntime.Toolkit.Maui.BookmarksView.GeoViewProperty, geoviewBinding);
}
+ // Note that the Web Scene Specification does not use bookmarks.
+ // As such, the BookmarksView will initially be empty, so click the "Set list" button to generate bookmarks.
private void SetSceneViewBinding_Click(object? sender, EventArgs e)
{
if (_viewContainer.Children.Contains(MySceneView) == false)
@@ -128,14 +130,16 @@ private void SetItemTemplateTwo_Click(object? sender, EventArgs e)
BookmarksView.ItemTemplate = template;
}
- private void AddSelectionListener_Click(object? sender, EventArgs e)
+ private void BookmarkListenerSwitch_Toggled(object sender, ToggledEventArgs e)
{
- BookmarksView.BookmarkSelected += BookmarkSelected;
- }
-
- private void RemoveSelectionListener_Click(object? sender, EventArgs e)
- {
- BookmarksView.BookmarkSelected -= BookmarkSelected;
+ if (BookmarkListenerSwitch.IsToggled)
+ {
+ BookmarksView.BookmarkSelected += BookmarkSelected;
+ }
+ else
+ {
+ BookmarksView.BookmarkSelected -= BookmarkSelected;
+ }
}
private void BookmarkSelected(object? sender, Bookmark bookmark)
diff --git a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml
index 5a749032d..93aacd1d0 100644
--- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml
+++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml
@@ -79,6 +79,7 @@
+
@@ -143,8 +144,8 @@
-
-
+
diff --git a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs
index 83b40c6c2..49acb3f39 100644
--- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs
+++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs
@@ -16,7 +16,7 @@ public sealed partial class BookmarksViewSample : Page
private const string webMapOneUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=e50fafe008ac4ce4ad2236de7fd149c3";
private const string webMapTwoUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=16f1b8ba37b44dc3884afc8d5f454dd2";
private const string webSceneOne = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=6b6588041965408e84ba319e12d9d7ad";
- private const string webSceneTwo = "https://www.arcgis.com/home/webscene/viewer.html?webscene=b9ad8372ff884bc4a4e78d936b170f7d";
+ private const string webSceneTwo = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=b3e2230e170d4f91aa3d47f88821743d";
private Random _randomizer = new Random();
@@ -46,6 +46,8 @@ private void SetMapViewBinding_Click(object sender, RoutedEventArgs e)
BookmarksView.SetBinding(UI.Controls.BookmarksView.GeoViewProperty, geoviewBinding);
}
+ // Note that the Web Scene Specification does not use bookmarks.
+ // As such, the BookmarksView will initially be empty, so click the "Set list" button to generate bookmarks.
private void SetSceneViewBinding_Click(object sender, RoutedEventArgs e)
{
MyMapView.Visibility = Visibility.Collapsed;
@@ -124,19 +126,30 @@ private void SetItemTemplateTwo_Click(object sender, RoutedEventArgs e)
BookmarksView.ItemTemplate = template;
}
- private void AddSelectionListener_Click(object sender, RoutedEventArgs e)
+ private void SelectionListenerToggle_Click(object sender, RoutedEventArgs e)
{
- BookmarksView.BookmarkSelected += BookmarkSelected;
- }
-
- private void RemoveSelectionListener_Click(object sender, RoutedEventArgs e)
- {
- BookmarksView.BookmarkSelected -= BookmarkSelected;
+ if (BookmarkListenerToggle.IsChecked == true)
+ {
+ BookmarksView.BookmarkSelected += BookmarkSelected;
+ BookmarkListenerToggle.Content = "Remove";
+ }
+ else
+ {
+ BookmarksView.BookmarkSelected -= BookmarkSelected;
+ BookmarkListenerToggle.Content = "Add";
+ }
}
private async void BookmarkSelected(object sender, Bookmark bookmark)
{
- await new MessageDialog($"{bookmark.Name} Selected!").ShowAsync();
+ await new ContentDialog
+ {
+ XamlRoot = Dialog.XamlRoot,
+ Title = "Bookmark Selected",
+ Content = bookmark.Name,
+ CloseButtonText = "Ok"
+ }
+ .ShowAsync();
}
private void SelectDefaultItemContainer_Click(object sender, RoutedEventArgs e)
diff --git a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml
index 86c4bb5f0..f7ced2e4c 100644
--- a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml
+++ b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml
@@ -138,8 +138,8 @@
-
-
+
diff --git a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs
index a3c95d6ff..e2ef624a1 100644
--- a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs
+++ b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs
@@ -27,7 +27,7 @@ public partial class BookmarksViewSample : UserControl
private const string webMapOneUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=e50fafe008ac4ce4ad2236de7fd149c3";
private const string webMapTwoUrl = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=16f1b8ba37b44dc3884afc8d5f454dd2";
private const string webSceneOne = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=6b6588041965408e84ba319e12d9d7ad";
- private const string webSceneTwo = "https://www.arcgis.com/home/webscene/viewer.html?webscene=b9ad8372ff884bc4a4e78d936b170f7d";
+ private const string webSceneTwo = "https://arcgisruntime.maps.arcgis.com/home/item.html?id=b3e2230e170d4f91aa3d47f88821743d";
private Random _randomizer = new Random();
@@ -57,6 +57,8 @@ private void SetMapViewBinding_Click(object sender, RoutedEventArgs e)
BookmarksView.SetBinding(UI.Controls.BookmarksView.GeoViewProperty, geoviewBinding);
}
+ // Note that the Web Scene specification does not use bookmarks.
+ // As such, the BookmarksView will initially be empty, so click the "Set list" button to generate bookmarks.
private void SetSceneViewBinding_Click(object sender, RoutedEventArgs e)
{
MyMapView.Visibility = Visibility.Collapsed;
@@ -135,14 +137,18 @@ private void SetItemTemplateTwo_Click(object sender, RoutedEventArgs e)
BookmarksView.ItemTemplate = template;
}
- private void AddSelectionListener_Click(object sender, RoutedEventArgs e)
+ private void SelectionListenerToggle_Click(object sender, RoutedEventArgs e)
{
- BookmarksView.BookmarkSelected += BookmarkSelected;
- }
-
- private void RemoveSelectionListener_Click(object sender, RoutedEventArgs e)
- {
- BookmarksView.BookmarkSelected -= BookmarkSelected;
+ if (SelectionListenerToggle.IsChecked == true)
+ {
+ BookmarksView.BookmarkSelected += BookmarkSelected;
+ SelectionListenerToggle.Content = "Remove";
+ }
+ else
+ {
+ BookmarksView.BookmarkSelected -= BookmarkSelected;
+ SelectionListenerToggle.Content = "Add";
+ }
}
private void BookmarkSelected(object sender, Bookmark bookmark)