Skip to content

Commit

Permalink
Merge v.next into main for release 200.2.0 (#1286)
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Weis <[email protected]>
Co-authored-by: William Bohrmann <[email protected]>
Co-authored-by: Zack Allen <[email protected]>
Co-authored-by: Morten Nielsen <[email protected]>
Co-authored-by: William Bohrmann <[email protected]>
Co-authored-by: Preeti <[email protected]>
Co-authored-by: Morten Nielsen <[email protected]>
Co-authored-by: Greg De Stigter <[email protected]>
  • Loading branch information
9 people authored Aug 16, 2023
1 parent 6bb33d8 commit af77781
Show file tree
Hide file tree
Showing 380 changed files with 5,597 additions and 3,689 deletions.
162 changes: 2 additions & 160 deletions src/ArcGIS.AllSampleViewers.sln

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<ArcGISMapsSDKVersion>200.2.0</ArcGISMapsSDKVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Esri.ArcGISRuntime" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.WPF" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.WPF" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Maui" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.Maui" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.WinUI" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Hydrography" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.LocalServices" Version="100.15.0" />
<PackageVersion Include="Esri.ArcGISRuntime.UWP" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.UWP" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Esri.ArcGISRuntime.Toolkit.WinUI" Version="$(ArcGISMapsSDKVersion)" />
<PackageVersion Include="Markdig" Version="0.30.4" />
<PackageVersion Include="System.Text.Json" Version="7.0.1" />
<PackageVersion Include="System.Speech" Version="7.0.0" />
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="7.0.0" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.Maui" Version="5.0.0" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageVersion Include="WinUIEx" Version="1.8.0" />
<PackageVersion Include="Xamarin.AndroidX.AppCompat" Version="1.5.1.1" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" Condition="'$(UseMaui)'!='true'" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" Condition="'$(UseMaui)'!='true'" />
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13"/>
<PackageVersion Include="Microsoft.Toolkit.Uwp.UI.Controls" Version="6.1.1"/>
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.5.0"/>
<PackageVersion Include="Monaco.Editor" Version="0.8.1-alpha"/>
</ItemGroup>
</Project>
22 changes: 10 additions & 12 deletions src/MAUI/Maui.Samples/ArcGIS.Samples.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,22 @@
</MauiAsset>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Hydrography" Version="200.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Maui" Version="200.1.0" />
<PackageReference Include="Esri.ArcGISRuntime.Toolkit.Maui" Version="200.1.0" />
<PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="CommunityToolkit.Maui" />
<PackageReference Include="CommunityToolkit.Mvvm" />
<PackageReference Include="Esri.ArcGISRuntime.Hydrography" />
<PackageReference Include="Esri.ArcGISRuntime.Maui" />
<PackageReference Include="Esri.ArcGISRuntime.Toolkit.Maui" />
<PackageReference Include="Markdig" />
<PackageReference Include="System.Drawing.Common" />
</ItemGroup>

<!-- WinUIEx is used to workaround the lack of a WebAuthenticationBroker for WinUI. https://github.com/microsoft/WindowsAppSDK/issues/441 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-windows10.0.19041.0'">
<PackageReference Include="WinUIEx" Version="1.8.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="7.0.0" />
<PackageReference Include="WinUIEx" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.5.1.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat" />
</ItemGroup>
<ItemGroup>
<Compile Update="ApiKeyView.xaml.cs">
Expand Down
36 changes: 0 additions & 36 deletions src/MAUI/Maui.Samples/Converters/ItemToImageSourceConverter.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/MAUI/Maui.Samples/Helpers/SampleLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static async Task LoadSample(SampleInfo sampleInfo)
AuthenticationManager.Current.ChallengeHandler = null;

// Load offline data before showing the sample.
if (sampleInfo.OfflineDataItems != null)
if (sampleInfo.OfflineDataItems != null && !await DataManager.HasSampleDataPresent(sampleInfo))
{
CancellationTokenSource cancellationSource = new CancellationTokenSource();

Expand Down
5 changes: 4 additions & 1 deletion src/MAUI/Maui.Samples/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
namespace ArcGIS.Samples.Maui;

using Esri.ArcGISRuntime.Maui;
using CommunityToolkit.Maui;
using Esri.ArcGISRuntime.Maui;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
#if __ANDROID__
Esri.ArcGISRuntime.UI.Controls.SceneView.MemoryLimit = 2 * 1073741824L; // 2Gb
#endif
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
Expand Down
3 changes: 1 addition & 2 deletions src/MAUI/Maui.Samples/SamplePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
</ContentPage.ToolbarItems>
<Grid>
<Border x:Name="SampleDetailPage" IsVisible="false">
<WebView x:Name="DescriptionView" />
</Border>
<Border x:Name="SourceCodePage" IsVisible="false">
<StackLayout>
Expand All @@ -34,7 +33,7 @@
Text=""
VerticalOptions="Center" />
</StackLayout>
<WebView x:Name="SourceCodeView" VerticalOptions="FillAndExpand" />
<Border x:Name="SourceCodeViewContainer" VerticalOptions="FillAndExpand" />
</StackLayout>
</Border>
<Border
Expand Down
87 changes: 48 additions & 39 deletions src/MAUI/Maui.Samples/SamplePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

using ArcGIS.Samples.Managers;
using ArcGIS.Samples.Shared.Models;
using Esri.ArcGISRuntime.Maui;
using Microsoft.Maui.Platform;
using System.Collections.ObjectModel;
using System.ComponentModel;
Expand All @@ -31,6 +32,9 @@ public partial class SamplePage
private ContentPage _sample;
private Assembly _assembly;
private int _lastViewedFileIndex = 0;
// single-instance webviews reused on each view, to avoid a memory leak in webview
static WebView DescriptionView = new WebView();
static WebView SourceCodeView = new WebView();

public ObservableCollection<SourceCodeFile> SourceFiles { get; } = new ObservableCollection<SourceCodeFile>();

Expand All @@ -41,13 +45,6 @@ public SamplePage()

public SamplePage(ContentPage sample, SampleInfo sampleInfo) : this()
{
this.NavigatedFrom += NavigatedFromEvent;

#if IOS || MACCATALYST
// iOS / MacCatalyst lifecycle works differently, so we need to use the main page changing instead of the NavigatedFrom event for this.
Application.Current.MainPage.PropertyChanged += MainPagePropertyChanged;
#endif

// Set the sample variable.
_sample = sample;

Expand Down Expand Up @@ -83,6 +80,50 @@ public SamplePage(ContentPage sample, SampleInfo sampleInfo) : this()
LoadSampleData(sampleInfo);
}

protected override void OnNavigatedTo(NavigatedToEventArgs args)
{
base.OnNavigatedTo(args);
SampleDetailPage.Content = DescriptionView;
SourceCodeViewContainer.Content = SourceCodeView;
DescriptionView.Navigating += Webview_Navigating;
SourceCodeView.Navigating += Webview_Navigating;
}

protected override void OnNavigatingFrom(NavigatingFromEventArgs args)
{
SampleDetailPage.Content = null;
SourceCodeViewContainer.Content = null;
DescriptionView.Navigating -= Webview_Navigating;
SourceCodeView.Navigating -= Webview_Navigating;
base.OnNavigatingFrom(args);
}

protected override void OnNavigatedFrom(NavigatedFromEventArgs args)
{
base.OnNavigatedFrom(args);

// Check that the navigation is backward from the sample and not forward into another page in the sample.
if (!Application.Current.MainPage.Navigation.NavigationStack.OfType<SamplePage>().Any())
{
// Explicit cleanup of the Map and SceneView instead of waiting for garbage collector can help when
// lots of geoviews are being opened and closed
foreach (var geoView in TreeWalker<GeoView>(_sample))
{
if (geoView is MapView mapView)
{
mapView.Map = null;
if (mapView.LocationDisplay != null) mapView.LocationDisplay.IsEnabled = false;
}
else if (geoView is SceneView sceneView) sceneView.Scene = null;

geoView.Handler?.DisconnectHandler();
}

if (_sample is IDisposable disposableSample) disposableSample.Dispose();
if (_sample is IARSample ARSample) ARSample.StopAugmentedReality();
}
}

private async void LoadSampleData(SampleInfo sampleInfo)
{
// Set up the description page.
Expand All @@ -93,7 +134,6 @@ private async void LoadSampleData(SampleInfo sampleInfo)
{
Html = htmlString
};
DescriptionView.Navigating += Webview_Navigating;
}
catch (Exception ex)
{
Expand All @@ -104,44 +144,13 @@ private async void LoadSampleData(SampleInfo sampleInfo)
{
LoadSourceCode(sampleInfo);

SourceCodeView.Navigating += Webview_Navigating;
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}

private void MainPagePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "CurrentPage")
{
TryDispose();
}
}

private void NavigatedFromEvent(object sender, NavigatedFromEventArgs e)
{
TryDispose();
}

private void TryDispose()
{
// Check that the navigation is backward from the sample and not forward into another page in the sample.
if (!Application.Current.MainPage.Navigation.NavigationStack.OfType<SamplePage>().Any())
{
// Explicit cleanup of the Map and SceneView instead of waiting for garbage collector can help when
// lots of geoviews are being opened and closed
foreach (var geoview in TreeWalker<Esri.ArcGISRuntime.Maui.GeoView>(_sample))
{
geoview.Handler?.DisconnectHandler();
}

if (_sample is IDisposable disposableSample) disposableSample.Dispose();
if (_sample is IARSample ARSample) ARSample.StopAugmentedReality();
}
}

private static IEnumerable<T> TreeWalker<T>(VisualElement root)
{
if (root is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:SceneView x:Name="MySceneView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid Padding="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui"
xmlns:sampleViewer="clr-namespace:ArcGIS.Resources">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:SceneView x:Name="MySceneView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<VerticalStackLayout Padding="5" Spacing="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui"
xmlns:sampleViewer="clr-namespace:ArcGIS.Resources">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid Padding="5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:SceneView x:Name="MySceneView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid ColumnSpacing="5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}" WidthRequest="{OnIdiom Default=-1}">
<Grid RowDefinitions="auto,auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView"
GeoViewTapped="GeoViewTapped"
Style="{DynamicResource EsriSampleGeoView}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView"
GeoViewTapped="MapView_Tapped"
Style="{DynamicResource EsriSampleGeoView}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView"
GeoViewTapped="MyMapView_GeoViewTapped"
Style="{DynamicResource EsriSampleGeoView}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid RowSpacing="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border Style="{DynamicResource EsriSampleControlPanel}">
<Grid RowSpacing="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<Grid Style="{DynamicResource EsriSampleContainer}">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<esriUI:MapView x:Name="MyMapView" Style="{DynamicResource EsriSampleGeoView}" />
<Border MaximumWidthRequest="300" Style="{DynamicResource EsriSampleControlPanel}">
<Grid Padding="5"
Expand Down
Loading

0 comments on commit af77781

Please sign in to comment.