diff --git a/src/MAUI/Maui.Samples/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs b/src/MAUI/Maui.Samples/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs index 421f9055b3..f8ab63d360 100644 --- a/src/MAUI/Maui.Samples/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs @@ -41,11 +41,18 @@ public partial class AnimateImageOverlay : ContentPage, IDisposable public AnimateImageOverlay() { InitializeComponent(); - Initialize(); + _ = Initialize(); } - private void Initialize() + private async Task Initialize() { + // This sample is only supported in x64 on .NET MAUI. + if (!Environment.Is64BitProcess) + { + await Application.Current.MainPage.DisplayAlert("Error", "This sample is only supported for .NET MAUI in x64. Run the sample viewer in x64 to use this sample.", "Exit"); + return; + } + // Create the scene. MySceneView.Scene = new Scene(BasemapStyle.ArcGISDarkGray); @@ -137,7 +144,7 @@ public void Dispose() { //Stop the animation when the sample is unloaded. _animationStopped = true; - _timer.Dispose(); + _timer?.Dispose(); } } } \ No newline at end of file diff --git a/src/WPF/WPF.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs b/src/WPF/WPF.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs index 9f928c12b6..c20cc34fec 100644 --- a/src/WPF/WPF.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs +++ b/src/WPF/WPF.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs @@ -52,6 +52,12 @@ public AnimateImageOverlay() private void Initialize() { + // This sample is only supported in x64 on WPF. + if (!Environment.Is64BitProcess) + { + MessageBox.Show("This sample is only supported for WPF in x64. Run the sample viewer in x64 to use this sample."); + } + // Create the scene. MySceneView.Scene = new Scene(new Basemap(new Uri("https://www.arcgis.com/home/item.html?id=1970c1995b8f44749f4b9b6e81b5ba45"))); diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs index 783741a02a..fba42a26a9 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs @@ -53,10 +53,10 @@ public AnimateImageOverlay() private async Task Initialize() { - // This sample is only supported in x64 on UWP. + // This sample is only supported in x64 on WinUI. if (!Environment.Is64BitProcess) { - await new MessageDialog2("This sample is only supported for UWP in x64. Run the sample viewer in x64 to use this sample.", "Error").ShowAsync(); + await new MessageDialog2("This sample is only supported for WinUI in x64. Run the sample viewer in x64 to use this sample.", "Error").ShowAsync(); return; }