Skip to content

Commit dc9de50

Browse files
williambohrmann3dotMortenduffhprathameshnarkhedepMaske
authored
200.7.0 Samples Release (#1586)
Co-authored-by: Morten Nielsen <[email protected]> Co-authored-by: Hamish Duff <[email protected]> Co-authored-by: Prathamesh Narkhede <[email protected]> Co-authored-by: Preeti <[email protected]> Co-authored-by: Matvei Stefarov <[email protected]>
1 parent e8c5ca6 commit dc9de50

File tree

233 files changed

+2830
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+2830
-897
lines changed

src/Directory.Packages.props

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<ArcGISMapsSDKVersion Condition="'$(ArcGISMapsSDKVersion)'==''">200.6.0</ArcGISMapsSDKVersion>
4+
<ArcGISMapsSDKVersion Condition="'$(ArcGISMapsSDKVersion)'==''">200.7.0</ArcGISMapsSDKVersion>
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageVersion Include="Esri.ArcGISRuntime" Version="$(ArcGISMapsSDKVersion)" />
@@ -11,7 +11,7 @@
1111
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.Maui" Version="$(ArcGISMapsSDKVersion)" />
1212
<PackageVersion Include="Esri.ArcGISRuntime.WinUI" Version="$(ArcGISMapsSDKVersion)" />
1313
<PackageVersion Include="Esri.ArcGISRuntime.Hydrography" Version="$(ArcGISMapsSDKVersion)" />
14-
<PackageVersion Include="Esri.ArcGISRuntime.LocalServices" Version="200.1.0" />
14+
<PackageVersion Include="Esri.ArcGISRuntime.LocalServices" Version="200.6.0" />
1515
<PackageVersion Include="Esri.ArcGISRuntime.UWP" Version="$(ArcGISMapsSDKVersion)" />
1616
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.UWP" Version="$(ArcGISMapsSDKVersion)" />
1717
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.WinUI" Version="$(ArcGISMapsSDKVersion)" />
@@ -22,17 +22,17 @@
2222
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
2323
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
2424
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
25-
<PackageVersion Include="CommunityToolkit.Maui" Version="9.0.1" />
25+
<PackageVersion Include="CommunityToolkit.Maui" Version="10.0.0" />
2626
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.2" />
2727
<PackageVersion Include="WinUIEx" Version="2.3.4" />
28-
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.5.240607001" Condition="'$(UseMaui)'!='true'" />
28+
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" Condition="'$(UseMaui)'!='true'" />
2929
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" Condition="'$(UseMaui)'!='true'" />
3030
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" />
3131
<PackageVersion Include="Microsoft.Toolkit.Uwp.UI.Controls" Version="6.1.1" />
3232
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.5.0" />
3333
<PackageVersion Include="Monaco.Editor" Version="0.8.1-alpha" />
34-
<PackageVersion Include="Microsoft.Maui.Controls" Version="8.0.70" />
35-
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
36-
<PackageVersion Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.3" />
34+
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.21" />
35+
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.21" />
36+
<PackageVersion Include="Xamarin.AndroidX.AppCompat" Version="1.7.0.4" />
3737
</ItemGroup>
38-
</Project>
38+
</Project>

src/MAUI/Maui.Samples/App.xaml.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ public App()
88
{
99
InitializeComponent();
1010

11-
MainPage = new AppShell();
1211
Current = this;
1312
}
13+
14+
protected override Window CreateWindow(IActivationState activationState)
15+
{
16+
return new Window(new AppShell());
17+
}
1418
}

src/MAUI/Maui.Samples/AppShell.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private async Task CheckApiKey()
3636
ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity();
3737
if (status != ApiKeyStatus.Valid)
3838
{
39-
await Navigation.PushAsync(new ApiKeyPage(), true);
39+
await Shell.Current.Navigation.PushAsync(new ApiKeyPage(), true);
4040
}
4141
}
4242
#endregion

src/MAUI/Maui.Samples/ArcGIS.Samples.Maui.csproj

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<OutputType>Exe</OutputType>
77
<RootNamespace>ArcGIS.Samples</RootNamespace>
88
<UseMaui>true</UseMaui>
@@ -21,16 +21,17 @@
2121
<ApplicationVersion>1</ApplicationVersion>
2222

2323
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
24-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
24+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
2525
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">26.0</SupportedOSPlatformVersion>
2626
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
2727
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</TargetPlatformMinVersion>
2828
<RootNamespace>ArcGIS</RootNamespace>
2929
<AssemblyName>ArcGIS</AssemblyName>
3030
<DefineConstants>$(DefineConstants);MAUI</DefineConstants>
31-
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
32-
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' AND '$(Platform)' == 'AnyCPU'">win10-x64</RuntimeIdentifier>
33-
<AppxPackageDir>..\..\..\output\$(RuntimeIdentifier)\</AppxPackageDir>
31+
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
32+
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' AND '$(Platform)' == 'AnyCPU'">win-x64</RuntimeIdentifier>
33+
<AppxPackageDir>..\..\..\output\$(RuntimeIdentifier)\</AppxPackageDir>
34+
<NoWarn>$(NoWarn);XC0022;XC0025</NoWarn> <!-- Disable XamlC warnings until addressed -->
3435
</PropertyGroup>
3536

3637
<ItemGroup>
@@ -67,7 +68,7 @@
6768
</ItemGroup>
6869

6970
<!-- Exclude Indoor Positioning on desktop platforms -->
70-
<ItemGroup Condition="$(TargetFramework.StartsWith('net8.0-maccatalyst')) or $(TargetFramework.StartsWith('net8.0-windows'))">
71+
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' or $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
7172
<AndroidResource Remove="Samples\Location\IndoorPositioning\**" />
7273
<Compile Remove="Samples\Location\IndoorPositioning\**" />
7374
<MauiCss Remove="Samples\Location\IndoorPositioning\**" />
@@ -141,11 +142,11 @@
141142
</ItemGroup>
142143

143144
<!-- WinUIEx is used to workaround the lack of a WebAuthenticationBroker for WinUI. https://github.com/microsoft/WindowsAppSDK/issues/441 -->
144-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-windows10.0.19041.0'">
145+
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
145146
<PackageReference Include="WinUIEx" />
146147
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
147148
</ItemGroup>
148-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
149+
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
149150
<PackageReference Include="Xamarin.AndroidX.AppCompat" />
150151
</ItemGroup>
151152
<ItemGroup>

src/MAUI/Maui.Samples/Helpers/ArcGISLoginPrompt.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static async Task<bool> EnsureAGOLCredentialAsync()
6262
}
6363
catch (Exception ex)
6464
{
65-
await Application.Current.MainPage.DisplayAlert("Login failed", ex.Message, "OK");
65+
await Application.Current.Windows[0].Page.DisplayAlert("Login failed", ex.Message, "OK");
6666
}
6767

6868
return loggedIn;

src/MAUI/Maui.Samples/Helpers/FeedbackPrompt.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal static class FeedbackPrompt
2020

2121
public async static Task ShowFeedbackPromptAsync()
2222
{
23-
await Application.Current.MainPage.DisplayActionSheet("Open an issue on GitHub:", "Cancel", null, [BugReport, FeatureRequest]).ContinueWith((result) =>
23+
await Application.Current.Windows[0].Page.DisplayActionSheet("Open an issue on GitHub:", "Cancel", null, [BugReport, FeatureRequest]).ContinueWith((result) =>
2424
{
2525
switch (result.Result)
2626
{

src/MAUI/Maui.Samples/Helpers/SampleLoader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ await DataManager.EnsureSampleDataPresent(sampleInfo, cancellationSource.Token,
7979
await Shell.Current.Navigation.PopModalAsync(false);
8080
}
8181

82-
await Application.Current.MainPage.DisplayAlert("", "Download cancelled", "OK");
82+
await Application.Current.Windows[0].Page.DisplayAlert("", "Download cancelled", "OK");
8383
}
8484
catch (Exception ex)
8585
{

src/MAUI/Maui.Samples/Platforms/Android/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.esri.arcgisruntime.samples.maui" android:versionCode="5" android:versionName="200.6.0">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.esri.arcgisruntime.samples.maui" android:versionCode="6" android:versionName="200.7.0">
33
<application android:allowBackup="true" android:usesCleartextTraffic="true" android:icon="@mipmap/appiconandroid" android:roundIcon="@mipmap/appiconandroid_round" android:supportsRtl="true" android:label="ArcGIS Maps .NET MAUI Samples"></application>
4-
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34" />
4+
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="35" />
55
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
66
<uses-permission android:name="android.permission.INTERNET" />
77
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

src/MAUI/Maui.Samples/Platforms/iOS/Helpers/KeyboardHelper.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ public static partial class KeyboardHelper
66
{
77
public static void HideKeyboard()
88
{
9-
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
9+
UIApplication.SharedApplication.ConnectedScenes
10+
.OfType<UIWindowScene>()
11+
.SelectMany(s => s.Windows)
12+
.FirstOrDefault(w => w.IsKeyWindow).EndEditing(true);
1013
}
1114
}
1215
}

src/MAUI/Maui.Samples/Samples/Analysis/LineOfSightGeoElement/LineOfSightGeoElement.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private async Task Initialize()
138138
}
139139
catch (Exception e)
140140
{
141-
await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
141+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.ToString(), "OK");
142142
}
143143
}
144144

src/MAUI/Maui.Samples/Samples/Analysis/QueryFeatureCountAndExtent/QueryFeatureCountAndExtent.xaml.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private async Task Initialize()
7979
}
8080
catch (Exception e)
8181
{
82-
await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
82+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.ToString(), "OK");
8383
}
8484
}
8585

@@ -107,7 +107,7 @@ private async void StatesPicker_SelectionChanged(object sender, EventArgs e)
107107
}
108108
catch (Exception ex)
109109
{
110-
await Application.Current.MainPage.DisplayAlert("Error", ex.ToString(), "OK");
110+
await Application.Current.Windows[0].Page.DisplayAlert("Error", ex.ToString(), "OK");
111111
}
112112
}
113113

@@ -134,7 +134,7 @@ private async void CountFeaturesButton_Click(object sender, EventArgs e)
134134
}
135135
catch (Exception ex)
136136
{
137-
await Application.Current.MainPage.DisplayAlert("Error", ex.ToString(), "OK");
137+
await Application.Current.Windows[0].Page.DisplayAlert("Error", ex.ToString(), "OK");
138138
}
139139
}
140140
}

src/MAUI/Maui.Samples/Samples/Analysis/ViewshedGeoElement/ViewshedGeoElement.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private async Task Initialize()
135135
}
136136
catch (Exception e)
137137
{
138-
await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
138+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.ToString(), "OK");
139139
}
140140
}
141141

src/MAUI/Maui.Samples/Samples/Data/AddFeaturesWithContingentValues/AddFeaturesWithContingentValues.xaml

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
55
<Grid>
66
<esriUI:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped" />
7-
<Frame x:Name="FeatureAttributesPopup"
8-
Margin="30"
9-
Padding="0"
10-
CornerRadius="0"
11-
HorizontalOptions="Center"
12-
IsVisible="False"
13-
VerticalOptions="Start"
14-
WidthRequest="300">
7+
<Border x:Name="FeatureAttributesPopup"
8+
Margin="30"
9+
Padding="0"
10+
BackgroundColor="{AppThemeBinding Dark=Black,
11+
Light=White}"
12+
HorizontalOptions="Center"
13+
IsVisible="False"
14+
VerticalOptions="Start"
15+
WidthRequest="300">
1516
<StackLayout Margin="5"
1617
Padding="15"
1718
Spacing="5">
@@ -46,6 +47,6 @@
4647
Text="Discard"
4748
WidthRequest="240" />
4849
</StackLayout>
49-
</Frame>
50+
</Border>
5051
</Grid>
5152
</ContentPage>

src/MAUI/Maui.Samples/Samples/Data/AddFeaturesWithContingentValues/AddFeaturesWithContingentValues.xaml.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private async Task QueryAndBufferFeatures()
135135
}
136136
catch (Exception e)
137137
{
138-
await Application.Current.MainPage.DisplayAlert("Error", e.Message, "OK");
138+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.Message, "OK");
139139
}
140140
}
141141

@@ -163,7 +163,7 @@ private async Task CreateNewEmptyFeature(Esri.ArcGISRuntime.Maui.GeoViewInputEve
163163
}
164164
catch (Exception ex)
165165
{
166-
await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
166+
await Application.Current.Windows[0].Page.DisplayAlert("Error", ex.Message, "OK");
167167
}
168168
}
169169

@@ -197,7 +197,7 @@ private async Task<List<string>> GetContingentValues(string field, string fieldG
197197
}
198198
catch (Exception e)
199199
{
200-
await Application.Current.MainPage.DisplayAlert("Error", e.Message, "OK");
200+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.Message, "OK");
201201
}
202202

203203
return contingentValuesNamesList;
@@ -250,7 +250,7 @@ private async Task DiscardFeature()
250250
}
251251
catch (Exception e)
252252
{
253-
await Application.Current.MainPage.DisplayAlert("Error", e.Message, "OK");
253+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.Message, "OK");
254254
}
255255
}
256256

@@ -274,13 +274,13 @@ private async Task UpdateField(string field, object value)
274274
break;
275275

276276
default:
277-
await Application.Current.MainPage.DisplayAlert("Error", $"{field} not found in any of the data dictionaries.", "OK");
277+
await Application.Current.Windows[0].Page.DisplayAlert("Error", $"{field} not found in any of the data dictionaries.", "OK");
278278
break;
279279
}
280280
}
281281
catch (Exception e)
282282
{
283-
await Application.Current.MainPage.DisplayAlert("Error", e.Message, "OK");
283+
await Application.Current.Windows[0].Page.DisplayAlert("Error", e.Message, "OK");
284284
}
285285
}
286286

@@ -344,7 +344,7 @@ private async Task SaveFeature()
344344
}
345345
else
346346
{
347-
await Application.Current.MainPage.DisplayAlert("Error", $"Error saving feature. {numberOfViolations} violation(s) in field group(s) {string.Join(", ", fieldGroupNames)}.", "OK");
347+
await Application.Current.Windows[0].Page.DisplayAlert("Error", $"Error saving feature. {numberOfViolations} violation(s) in field group(s) {string.Join(", ", fieldGroupNames)}.", "OK");
348348
}
349349
}
350350

src/MAUI/Maui.Samples/Samples/Data/CreateMobileGeodatabase/CreateMobileGeodatabase.xaml.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private async Task CreateGeodatabase()
101101
}
102102
catch (Exception ex)
103103
{
104-
await Application.Current.MainPage.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
104+
await Application.Current.Windows[0].Page.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
105105
}
106106
}
107107

@@ -131,7 +131,7 @@ private async Task AddFeature(MapPoint location)
131131
}
132132
catch (Exception ex)
133133
{
134-
await Application.Current.MainPage.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
134+
await Application.Current.Windows[0].Page.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
135135
}
136136
}
137137

@@ -178,7 +178,7 @@ private void CloseGeodatabaseClick(object sender, EventArgs e)
178178
}
179179
catch (Exception ex)
180180
{
181-
Application.Current.MainPage.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
181+
DisplayAlert(ex.GetType().Name, ex.Message, "OK");
182182
}
183183
}
184184

@@ -195,7 +195,7 @@ await Share.RequestAsync(new ShareFileRequest
195195
}
196196
catch (Exception ex)
197197
{
198-
await Application.Current.MainPage.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
198+
await Application.Current.Windows[0].Page.DisplayAlert(ex.GetType().Name, ex.Message, "OK");
199199
}
200200
}
201201

0 commit comments

Comments
 (0)