From 0b420e336917dee6165cb04484b57d3b0b618151 Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Wed, 10 Jan 2024 11:40:49 -0800 Subject: [PATCH 1/7] WinUI app crash fix --- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 6 ++++++ src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs | 2 ++ 2 files changed, 8 insertions(+) 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..5502783e0 100644 --- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -136,7 +136,13 @@ private void RemoveSelectionListener_Click(object sender, RoutedEventArgs e) private async void BookmarkSelected(object sender, Bookmark bookmark) { +#if WINUI + var dialog = new MessageDialog($"{bookmark.Name} Selected!"); + WinRT.Interop.InitializeWithWindow.Initialize(dialog, App.CurrentWindowHandle); + await dialog.ShowAsync(); +#else await new MessageDialog($"{bookmark.Name} Selected!").ShowAsync(); +#endif } private void SelectDefaultItemContainer_Click(object sender, RoutedEventArgs e) diff --git a/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs b/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs index efaf5a335..02bbc914a 100644 --- a/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs @@ -47,5 +47,7 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar } private Window m_window; + + public static IntPtr CurrentWindowHandle => WinRT.Interop.WindowNative.GetWindowHandle(((App)Current).m_window); } } From 82dff3a45e6138063822594f4c366df456bb950f Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Wed, 10 Jan 2024 11:50:56 -0800 Subject: [PATCH 2/7] data fix --- .../Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs | 2 +- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 +- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs index 1a6137a9a..34dd6913f 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(); 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 5502783e0..05d9393c3 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(); 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..81d6afac3 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(); From 3b161d55347467cf1c05404281f1febd9aad4b3c Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Wed, 10 Jan 2024 11:53:06 -0800 Subject: [PATCH 3/7] web scene spec comments --- .../Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs | 2 ++ .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 ++ .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs index 34dd6913f..17aaece82 100644 --- a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs @@ -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 uses presentation slides in lieu of 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) 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 05d9393c3..a14002fc5 100644 --- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -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 uses presentation slides in lieu of 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; 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 81d6afac3..32da6af52 100644 --- a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -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 uses presentation slides in lieu of 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; From 7571cd445cae1bfd098b5c169f26438ff3eb2045 Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Thu, 1 Feb 2024 15:35:41 -0800 Subject: [PATCH 4/7] Revert "WinUI app crash fix" This reverts commit 0b420e336917dee6165cb04484b57d3b0b618151. --- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 6 ------ src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs | 2 -- 2 files changed, 8 deletions(-) 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 a14002fc5..f562d4c93 100644 --- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -138,13 +138,7 @@ private void RemoveSelectionListener_Click(object sender, RoutedEventArgs e) private async void BookmarkSelected(object sender, Bookmark bookmark) { -#if WINUI - var dialog = new MessageDialog($"{bookmark.Name} Selected!"); - WinRT.Interop.InitializeWithWindow.Initialize(dialog, App.CurrentWindowHandle); - await dialog.ShowAsync(); -#else await new MessageDialog($"{bookmark.Name} Selected!").ShowAsync(); -#endif } private void SelectDefaultItemContainer_Click(object sender, RoutedEventArgs e) diff --git a/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs b/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs index 02bbc914a..efaf5a335 100644 --- a/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.WinUI/App.xaml.cs @@ -47,7 +47,5 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar } private Window m_window; - - public static IntPtr CurrentWindowHandle => WinRT.Interop.WindowNative.GetWindowHandle(((App)Current).m_window); } } From 345328ec4b32b34e6989737301f05784f41d1d8f Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Thu, 1 Feb 2024 16:11:38 -0800 Subject: [PATCH 5/7] webscene spec comments --- .../Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs | 2 +- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 +- .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs index 17aaece82..afdab0361 100644 --- a/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.Maui/Samples/BookmarksViewSample.xaml.cs @@ -48,7 +48,7 @@ private void SetMapViewBinding_Click(object? sender, EventArgs e) BookmarksView.SetBinding(Esri.ArcGISRuntime.Toolkit.Maui.BookmarksView.GeoViewProperty, geoviewBinding); } - // Note that the Web Scene specification uses presentation slides in lieu of bookmarks. + // 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) { 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 f562d4c93..d9c54be3d 100644 --- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -46,7 +46,7 @@ private void SetMapViewBinding_Click(object sender, RoutedEventArgs e) BookmarksView.SetBinding(UI.Controls.BookmarksView.GeoViewProperty, geoviewBinding); } - // Note that the Web Scene specification uses presentation slides in lieu of bookmarks. + // 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) { 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 32da6af52..25b5870c3 100644 --- a/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.WPF/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -57,7 +57,7 @@ private void SetMapViewBinding_Click(object sender, RoutedEventArgs e) BookmarksView.SetBinding(UI.Controls.BookmarksView.GeoViewProperty, geoviewBinding); } - // Note that the Web Scene specification uses presentation slides in lieu of bookmarks. + // 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) { From 2769bf644dca94c5a4e9a2adb99f5d1607699681 Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Thu, 1 Feb 2024 16:12:16 -0800 Subject: [PATCH 6/7] content dialog --- .../Samples/BookmarksView/BookmarksViewSample.xaml | 1 + .../Samples/BookmarksView/BookmarksViewSample.xaml.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml index 5a749032d..c0aeea0b4 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 @@ + 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 d9c54be3d..17d406a40 100644 --- a/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs +++ b/src/Samples/Toolkit.SampleApp.UWP/Samples/BookmarksView/BookmarksViewSample.xaml.cs @@ -138,7 +138,14 @@ private void RemoveSelectionListener_Click(object sender, RoutedEventArgs e) 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) From 395443ec9fde0d0776f997c87d9ab359b1d049ab Mon Sep 17 00:00:00 2001 From: William Bohrmann Date: Fri, 2 Feb 2024 12:39:53 -0800 Subject: [PATCH 7/7] toggle listeners --- .../Samples/BookmarksViewSample.xaml | 4 ++-- .../Samples/BookmarksViewSample.xaml.cs | 16 +++++++++------- .../BookmarksView/BookmarksViewSample.xaml | 4 ++-- .../BookmarksView/BookmarksViewSample.xaml.cs | 18 +++++++++++------- .../BookmarksView/BookmarksViewSample.xaml | 4 ++-- .../BookmarksView/BookmarksViewSample.xaml.cs | 18 +++++++++++------- 6 files changed, 37 insertions(+), 27 deletions(-) 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 @@