Skip to content

Commit 34e3ab3

Browse files
Dialogs when running AnimateImageOverlay sample in x86 (#1531)
1 parent 56779f6 commit 34e3ab3

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/MAUI/Maui.Samples/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ public partial class AnimateImageOverlay : ContentPage, IDisposable
4141
public AnimateImageOverlay()
4242
{
4343
InitializeComponent();
44-
Initialize();
44+
_ = Initialize();
4545
}
4646

47-
private void Initialize()
47+
private async Task Initialize()
4848
{
49+
// This sample is only supported in x64 on .NET MAUI.
50+
if (!Environment.Is64BitProcess)
51+
{
52+
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");
53+
return;
54+
}
55+
4956
// Create the scene.
5057
MySceneView.Scene = new Scene(BasemapStyle.ArcGISDarkGray);
5158

@@ -137,7 +144,7 @@ public void Dispose()
137144
{
138145
//Stop the animation when the sample is unloaded.
139146
_animationStopped = true;
140-
_timer.Dispose();
147+
_timer?.Dispose();
141148
}
142149
}
143150
}

src/WPF/WPF.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public AnimateImageOverlay()
5252

5353
private void Initialize()
5454
{
55+
// This sample is only supported in x64 on WPF.
56+
if (!Environment.Is64BitProcess)
57+
{
58+
MessageBox.Show("This sample is only supported for WPF in x64. Run the sample viewer in x64 to use this sample.");
59+
}
60+
5561
// Create the scene.
5662
MySceneView.Scene = new Scene(new Basemap(new Uri("https://www.arcgis.com/home/item.html?id=1970c1995b8f44749f4b9b6e81b5ba45")));
5763

src/WinUI/ArcGIS.WinUI.Viewer/Samples/SceneView/AnimateImageOverlay/AnimateImageOverlay.xaml.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public AnimateImageOverlay()
5353

5454
private async Task Initialize()
5555
{
56-
// This sample is only supported in x64 on UWP.
56+
// This sample is only supported in x64 on WinUI.
5757
if (!Environment.Is64BitProcess)
5858
{
59-
await new MessageDialog2("This sample is only supported for UWP in x64. Run the sample viewer in x64 to use this sample.", "Error").ShowAsync();
59+
await new MessageDialog2("This sample is only supported for WinUI in x64. Run the sample viewer in x64 to use this sample.", "Error").ShowAsync();
6060
return;
6161
}
6262

0 commit comments

Comments
 (0)