Skip to content

Commit d4ea16b

Browse files
dotMortenMorten Nielsenprathameshnarkhedemstefarovjona7150
authored
v.next (#612)
* Set up v.next branch * Add FeatureForms for WinUI and UWP (#591) * Minor UI tweaks to feature forms * Switch cancelButton image to FontImageSource allowing for more flexible and scalable icon usage (#593) * Switch cancelButton image to FontImageSource allowing for more flexible and scalable icon usage with support for Dark/Light mode fixes. * Update cancelButton icon color to #6E6E6E Removed unused resources. * Localize the View hyperlink string * FeatureForms: Adds TextFormElement support (#604) * Initial work on TextFormElementView support * Initial support of TextFormElement without Markdown rendering * Set style on UWP * Add missing line * Remove extra * Update src/Toolkit/Toolkit/UI/Controls/FeatureForm/FeatureFormElementTemplateSelector.cs Co-authored-by: Matvei Stefarov <[email protected]> --------- Co-authored-by: Morten Nielsen <[email protected]> Co-authored-by: Matvei Stefarov <[email protected]> * Add support for markdown (#605) * Add support for markdown * Fixes layout issues with search view in MAUI (#609) * feat(localization): update pseudo translation (#608) * Update pseudo translation - @mit10976 @Isa13169 @nia13404 * Update translation - @mit10976 @Isa13169 @nia13404 * Update translation - @mit10976 @Isa13169 @nia13404 * Fix toolkit warnings * Deprecate PopupManager property * Don't use PopupManager property that is deprecated * Address build warnings from recent SDK updates * Use fonticon instead of bitmap for basemap gallery * Don't use deprecated overload * Delete unused resources * Remove use of image icons in MeasureToolbar and use FontIcon instead This also avoids build warnings with packaging image content * Fix nuget pack warnins caused by duplicate analyzer includes * Fix tetformelements not rendering inside groups * Mark WinRT classes partial for better AoT support * Fix font references in UWP and WinUI (#611) * Remove unused attribute that also generates app build errors --------- Co-authored-by: Morten Nielsen <[email protected]> Co-authored-by: Prathamesh Narkhede <[email protected]> Co-authored-by: Prathamesh Narkhede <[email protected]> Co-authored-by: Matvei Stefarov <[email protected]> Co-authored-by: Jonathan Turpin <[email protected]>
1 parent 9312624 commit d4ea16b

File tree

146 files changed

+4345
-1344
lines changed

Some content is hidden

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

146 files changed

+4345
-1344
lines changed

src/Analyzers/Toolkit.Maui.Analyzers.UnitTests/Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1010
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
1111
<DisableAGSRuntimeTFMCheck>true</DisableAGSRuntimeTFMCheck>
12+
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

src/Directory.Build.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22

33
<PropertyGroup>
4-
<ArcGISRuntimeToolkitPackageVersion Condition="'$(ArcGISRuntimeToolkitPackageVersion)'==''">200.5.0</ArcGISRuntimeToolkitPackageVersion>
5-
<ArcGISRuntimePackageVersion Condition="'$(ArcGISRuntimePackageVersion)'==''">200.5.0</ArcGISRuntimePackageVersion>
4+
<ArcGISRuntimeToolkitPackageVersion Condition="'$(ArcGISRuntimeToolkitPackageVersion)'==''">200.6.0</ArcGISRuntimeToolkitPackageVersion>
5+
<ArcGISRuntimePackageVersion Condition="'$(ArcGISRuntimePackageVersion)'==''">200.6.0</ArcGISRuntimePackageVersion>
66

77
<!--Common package properties-->
88
<Authors>Esri Inc.</Authors>
@@ -94,6 +94,10 @@
9494
<Link>icon.png</Link>
9595
<Visible>false</Visible>
9696
</None>
97+
<None Include="$(MSBuildThisFileDirectory)\THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="\">
98+
<Link>THIRD-PARTY-NOTICES.TXT</Link>
99+
<Visible>false</Visible>
100+
</None>
97101
</ItemGroup>
98102

99103
<!--

src/Samples/Toolkit.SampleApp.Maui/Samples/SearchViewSample.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Grid RowSpacing="0">
1313
<Grid.RowDefinitions>
1414
<RowDefinition Height="32" />
15-
<RowDefinition Height="{OnPlatform WinUI=400, Default=Auto}" />
15+
<RowDefinition Height="Auto" />
1616
<RowDefinition Height="*" />
1717
</Grid.RowDefinitions>
1818
<esri:MapView x:Name="MyMapView" Grid.Row="1" Grid.RowSpan="2" />
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<Page
2+
x:Class="Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.Forms.FeatureFormViewSample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:esri="using:Esri.ArcGISRuntime.UI.Controls"
8+
xmlns:toolkit="using:Esri.ArcGISRuntime.Toolkit.UI.Controls"
9+
mc:Ignorable="d">
10+
11+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
12+
<Grid.ColumnDefinitions>
13+
<ColumnDefinition Width="*" />
14+
<ColumnDefinition Width="Auto" />
15+
</Grid.ColumnDefinitions>
16+
<esri:MapView x:Name="mapView"
17+
Map="{x:Bind Map}"
18+
GeoViewTapped="mapView_GeoViewTapped"/>
19+
20+
<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10" BorderThickness="1" BorderBrush="{ThemeResource ApplicationForegroundThemeBrush}">
21+
<Border Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Opacity=".8" />
22+
<TextBlock Text="Click a feature to open its FeatureFormView" FontSize="18" Margin="5" />
23+
</Grid>
24+
25+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Visibility="Collapsed" x:Name="SidePanel" Grid.Column="1">
26+
<Border BorderBrush="{ThemeResource ApplicationForegroundThemeBrush}" BorderThickness="1,0,0,0" HorizontalAlignment="Center" Width="300" >
27+
<Grid>
28+
<Grid.RowDefinitions>
29+
<RowDefinition/>
30+
<RowDefinition Height="Auto"/>
31+
</Grid.RowDefinitions>
32+
<toolkit:FeatureFormView x:Name="formViewer" Margin="5,5,5,0" VerticalScrollBarVisibility="Hidden" Grid.ColumnSpan="3" />
33+
<Border BorderThickness="0,1,0,0" BorderBrush="{ThemeResource ApplicationForegroundThemeBrush}" Background="#eeeeee" Grid.Row="1" Grid.ColumnSpan="3" Padding="5">
34+
<Grid>
35+
<Grid.ColumnDefinitions >
36+
<ColumnDefinition />
37+
<ColumnDefinition />
38+
<ColumnDefinition />
39+
</Grid.ColumnDefinitions>
40+
<Button Content="Close" Background="#007AC2" Foreground="White" Padding="5" Click="CloseButton_Click" Grid.Column="0" HorizontalAlignment="Stretch" />
41+
<Button Content="Reset" Margin="5,0" Background="#D83020" Foreground="White" Padding="5" Click="DiscardButton_Click" Grid.Column="1" HorizontalAlignment="Stretch" />
42+
<Button Content="Apply" Background="#35AC46" Foreground="White" Padding="5" Click="UpdateButton_Click" Grid.Column="2" HorizontalAlignment="Stretch" />
43+
</Grid>
44+
</Border>
45+
</Grid>
46+
</Border>
47+
</Grid>
48+
</Grid>
49+
</Page>
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
using Esri.ArcGISRuntime.Data;
2+
using Esri.ArcGISRuntime.Mapping;
3+
using Esri.ArcGISRuntime.Mapping.FeatureForms;
4+
using Esri.ArcGISRuntime.Mapping.Popups;
5+
using Esri.ArcGISRuntime.UI;
6+
using Esri.ArcGISRuntime.UI.Controls;
7+
using System;
8+
using System.Collections.Generic;
9+
using System.Linq;
10+
using Windows.UI.Popups;
11+
12+
namespace Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.Forms
13+
{
14+
public sealed partial class FeatureFormViewSample : Page
15+
{
16+
public FeatureFormViewSample()
17+
{
18+
this.InitializeComponent();
19+
}
20+
21+
// Webmap configured with feature forms
22+
public Map Map { get; } = new Map(new Uri("https://www.arcgis.com/home/item.html?id=f72207ac170a40d8992b7a3507b44fad"));
23+
private async void mapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
24+
{
25+
try
26+
{
27+
var result = await mapView.IdentifyLayersAsync(e.Position, 3, false);
28+
29+
// Retrieves feature from IdentifyLayerResult with a form definition
30+
var feature = GetFeature(result, out var def);
31+
if (feature != null)
32+
{
33+
formViewer.FeatureForm = new FeatureForm(feature);
34+
SidePanel.Visibility = Visibility.Visible;
35+
}
36+
}
37+
catch (Exception ex)
38+
{
39+
System.Diagnostics.Debug.WriteLine("Error: " + ex.Message);
40+
}
41+
}
42+
43+
private ArcGISFeature GetFeature(IEnumerable<IdentifyLayerResult> results, out FeatureFormDefinition def)
44+
{
45+
def = null;
46+
if (results == null)
47+
return null;
48+
foreach (var result in results.Where(r => r.LayerContent is FeatureLayer layer && (layer.FeatureFormDefinition is not null || (layer.FeatureTable as ArcGISFeatureTable)?.FeatureFormDefinition is not null)))
49+
{
50+
var feature = result.GeoElements?.OfType<ArcGISFeature>()?.FirstOrDefault();
51+
def = (result.LayerContent as FeatureLayer)?.FeatureFormDefinition ?? ((result.LayerContent as FeatureLayer)?.FeatureTable as ArcGISFeatureTable)?.FeatureFormDefinition;
52+
if (feature != null && def != null)
53+
{
54+
return feature;
55+
}
56+
}
57+
58+
return null;
59+
}
60+
61+
private async void DiscardButton_Click(object sender, RoutedEventArgs e)
62+
{
63+
ContentDialog dialog = new ContentDialog
64+
{
65+
Title = "Discard edits?",
66+
Content = "Are you sure you want to discard edits?",
67+
PrimaryButtonText = "Yes",
68+
CloseButtonText = "No",
69+
#if !WINDOWS_UWP
70+
XamlRoot = this.XamlRoot
71+
#endif
72+
};
73+
var result = await dialog.ShowAsync();
74+
if (result == ContentDialogResult.Primary)
75+
{
76+
((Button)sender).IsEnabled = false;
77+
try
78+
{
79+
await formViewer.DiscardEditsAsync();
80+
}
81+
catch { }
82+
((Button)sender).IsEnabled = true;
83+
}
84+
}
85+
86+
private void CloseButton_Click(object sender, RoutedEventArgs e)
87+
{
88+
formViewer.FeatureForm = null;
89+
SidePanel.Visibility = Visibility.Collapsed;
90+
}
91+
92+
private async void UpdateButton_Click(object sender, RoutedEventArgs e)
93+
{
94+
if (!formViewer.IsValid)
95+
{
96+
var errorsMessages = formViewer.FeatureForm.Elements.OfType<FieldFormElement>().Where(e => e.ValidationErrors.Any()).Select(s => s.FieldName + ": " + string.Join(",", s.ValidationErrors.Select(e => e.Message)));
97+
if (errorsMessages.Any())
98+
{
99+
await new ContentDialog
100+
{
101+
Title = "Can't apply",
102+
Content = "Form has errors:\n" + string.Join("\n", errorsMessages),
103+
PrimaryButtonText = "OK",
104+
#if !WINDOWS_UWP
105+
XamlRoot = this.XamlRoot
106+
#endif
107+
}.ShowAsync();
108+
return;
109+
}
110+
}
111+
try
112+
{
113+
await formViewer.FinishEditingAsync();
114+
}
115+
catch (Exception ex)
116+
{
117+
await new ContentDialog
118+
{
119+
Title = "Error",
120+
Content = "Failed to apply edits:\n" + ex.Message,
121+
PrimaryButtonText = "OK",
122+
#if !WINDOWS_UWP
123+
XamlRoot = this.XamlRoot
124+
#endif
125+
}.ShowAsync();
126+
}
127+
}
128+
}
129+
}

src/Samples/Toolkit.SampleApp.UWP/Toolkit.Samples.UWP.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@
134134
<Compile Include="Samples\FloorFilter\FloorFilterSample.xaml.cs">
135135
<DependentUpon>FloorFilterSample.xaml</DependentUpon>
136136
</Compile>
137+
<Compile Include="Samples\Forms\FeatureFormViewSample.xaml.cs">
138+
<DependentUpon>FeatureFormViewSample.xaml</DependentUpon>
139+
</Compile>
137140
<Compile Include="Samples\GeoViewController\GeoViewControllerSample.xaml.cs">
138141
<DependentUpon>GeoViewControllerSample.xaml</DependentUpon>
139142
</Compile>
@@ -231,6 +234,10 @@
231234
<Generator>MSBuild:Compile</Generator>
232235
<SubType>Designer</SubType>
233236
</Page>
237+
<Page Include="Samples\Forms\FeatureFormViewSample.xaml">
238+
<Generator>MSBuild:Compile</Generator>
239+
<SubType>Designer</SubType>
240+
</Page>
234241
<Page Include="Samples\GeoViewController\GeoViewControllerSample.xaml">
235242
<SubType>Designer</SubType>
236243
<Generator>MSBuild:Compile</Generator>
@@ -351,4 +358,4 @@
351358
<Target Name="AfterBuild">
352359
</Target>
353360
-->
354-
</Project>
361+
</Project>

src/THIRD-PARTY-NOTICES.TXT

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
The ArcGIS Maps SDK for .NET Toolkit uses third-party libraries or other resources that
2+
may be distributed under licenses different than the ArcGIS Maps SDK software.
3+
4+
The attached notices are provided for information only.
5+
6+
License notice for Markdig v0.31
7+
=========================================
8+
9+
Copyright (c) 2018-2019, Alexandre Mutel
10+
All rights reserved.
11+
12+
Redistribution and use in source and binary forms, with or without modification
13+
, are permitted provided that the following conditions are met:
14+
15+
1. Redistributions of source code must retain the above copyright notice, this
16+
list of conditions and the following disclaimer.
17+
18+
2. Redistributions in binary form must reproduce the above copyright notice,
19+
this list of conditions and the following disclaimer in the documentation
20+
and/or other materials provided with the distribution.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/Toolkit/Toolkit.Maui/Esri.ArcGISRuntime.Toolkit.Maui.csproj

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,19 @@
3737
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net8.0'))">
3838
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
3939
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
40+
<PackageReference Include="Markdig" Version="0.31.0" />
4041
</ItemGroup>
4142

4243
<Import Project="..\..\CommonProperties.targets" />
4344
<Import Project="..\Toolkit\Esri.ArcGISRuntime.Toolkit.Shared.projitems" Label="Shared" />
4445
<Import Project="$(SolutionDir)toolkit.props" Condition="Exists('$(SolutionDir)toolkit.props')" />
4546

4647
<!-- Analyzers -->
47-
<PropertyGroup>
48-
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput</TargetsForTfmSpecificContentInPackage>
49-
</PropertyGroup>
5048
<ItemGroup>
51-
<ProjectReference Include="..\..\Analyzers\Toolkit.Maui.Analyzers.CodeFixes\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.CodeFixes.csproj" PrivateAssets="all" />
52-
<ProjectReference Include="..\..\Analyzers\Toolkit.Maui.Analyzers\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.csproj" PrivateAssets="all" />
49+
<ProjectReference Include="..\..\Analyzers\Toolkit.Maui.Analyzers.CodeFixes\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.CodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
50+
<ProjectReference Include="..\..\Analyzers\Toolkit.Maui.Analyzers\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
51+
<None Include="..\..\Analyzers\Toolkit.Maui.Analyzers\bin\$(Configuration)\netstandard2.0\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Link="analyzers\dotnet\cs\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.dll" />
52+
<None Include="..\..\Analyzers\Toolkit.Maui.Analyzers.CodeFixes\bin\$(Configuration)\netstandard2.0\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Link="analyzers\dotnet\cs\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.CodeFixes.dll" />
5353
<None Include="tools\*.ps1" CopyToOutputDirectory="PreserveNewest" Pack="true" PackagePath="tools" />
5454
</ItemGroup>
55-
<Target Name="_AddAnalyzersToOutput">
56-
<ItemGroup>
57-
<TfmSpecificPackageFile Include="$(OutputPath)\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.dll" PackagePath="analyzers/dotnet/cs" />
58-
<TfmSpecificPackageFile Include="$(OutputPath)\Esri.ArcGISRuntime.Toolkit.Maui.Analyzers.CodeFixes.dll" PackagePath="analyzers/dotnet/cs" />
59-
</ItemGroup>
60-
</Target>
6155
</Project>

0 commit comments

Comments
 (0)