<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET) in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1192485#M11138</link>
    <description>&lt;P&gt;Hi Morten,&lt;/P&gt;&lt;P&gt;Wondering if anything in the latest updates might impact iOS showing a MapView.&amp;nbsp; I'm at Visual Studio Version 17.3.0 Preview 3.0 and Runtime&amp;nbsp;100.14.1-preview3.&amp;nbsp; I get a map to show up in Windows but not in iOS 15.5 simulator.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;-Joe&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 15:03:27 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2022-07-15T15:03:27Z</dc:date>
    <item>
      <title>Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158151#M10855</link>
      <description>&lt;P&gt;Tested with MAUI Preview 14 and ArcGIS Runtime for .NET 100.13&lt;BR /&gt;&lt;BR /&gt;Works on Windows and Android, but not IOS.&lt;BR /&gt;&lt;BR /&gt;Code to create a MapView control for use in MAUI, and map it to the ArcGIS Runtime MapView.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Microsoft.Maui.Handlers;
using EsriMap = Esri.ArcGISRuntime.Mapping.Map;

namespace MauiApp;

public interface IMapView : IView
{
    EsriMap Map { get; set; }
}

public class MapView : View, IMapView
{
    public static readonly BindableProperty MapProperty = BindableProperty.Create(
        nameof(Map), typeof(EsriMap), typeof(MapView));

    public EsriMap Map
    {
        get =&amp;gt; (EsriMap)GetValue(MapProperty);
        set =&amp;gt; SetValue(MapProperty, value);
    }
}

public class MapViewHandler : ViewHandler&amp;lt;IMapView, Esri.ArcGISRuntime.UI.Controls.MapView&amp;gt;
{
    public MapViewHandler() : base(PropertyMapper, CommandMapper)
    {
    }

    public static readonly PropertyMapper&amp;lt;IMapView, MapViewHandler&amp;gt; PropertyMapper = new PropertyMapper&amp;lt;IMapView, MapViewHandler&amp;gt;(ViewMapper)
    {
        [nameof(IMapView.Map)] = MapMap
    };

    public static readonly CommandMapper&amp;lt;IButton, IButtonHandler&amp;gt; CommandMapper = new CommandMapper&amp;lt;IButton, IButtonHandler&amp;gt;(ViewCommandMapper);

    private static void MapMap(MapViewHandler handler, IMapView view)
    {
        handler.PlatformView.Map = view.Map;
    }

    protected override Esri.ArcGISRuntime.UI.Controls.MapView CreatePlatformView()
    {
#if ANDROID
        return new Esri.ArcGISRuntime.UI.Controls.MapView(Context);
#else
        return new Esri.ArcGISRuntime.UI.Controls.MapView();
#endif
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Register with MAUI app builder in MauiProgram.cs&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;ConfigureMauiHandlers(handlers =&amp;gt;
{
    handlers.AddHandler(typeof(MapView), typeof(MapViewHandler));
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add ArcGIS Runtime NuGet packages.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;ItemGroup Condition="$(TargetFramework.Contains('-windows'))"&amp;gt;
    &amp;lt;PackageReference Include="Esri.ArcGISRuntime.WinUI" Version="100.13.0" /&amp;gt;
&amp;lt;/ItemGroup&amp;gt;

&amp;lt;ItemGroup Condition="$(TargetFramework.Contains('-android'))"&amp;gt;
    &amp;lt;PackageReference Include="Esri.ArcGISRuntime.Xamarin.Android" Version="100.13.0" /&amp;gt;
&amp;lt;/ItemGroup&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 21:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158151#M10855</guid>
      <dc:creator>esp1rl</dc:creator>
      <dc:date>2022-03-26T21:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158162#M10858</link>
      <description>&lt;P&gt;.NET 6-ios and .NET 6-android support isn't at this point supported, but considered preview. After we shipped Update 13, Microsoft updated their .NET 6 ios runtime with lots of breaking changes, which is what you're hitting.&lt;/P&gt;&lt;P&gt;We just shipped Update 13.1 a few days ago, and it's compiled with the latest, so (for now at least) that version should work with iOS (I've successfully used it). I have a MAUI sample here you can also play with and is quite similar to what you have:&amp;nbsp;&lt;A href="https://github.com/dotMorten/MauiPlayground/tree/main/Esri.ArcGISRuntime.Maui" target="_blank" rel="noopener"&gt;https://github.com/dotMorten/MauiPlayground/tree/main/Esri.ArcGISRuntime.Maui&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 23:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158162#M10858</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2022-03-26T23:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158346#M10863</link>
      <description>&lt;P&gt;Thanks Morten, I will update to v13.1 and get IOS up and running.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 13:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1158346#M10863</guid>
      <dc:creator>esp1rl</dc:creator>
      <dc:date>2022-03-28T13:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1161660#M10885</link>
      <description>&lt;P&gt;Good news! We have an official preview you can now use:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdks-blog/announcing-preview-1-of-net-maui-support-with/ba-p/1160505" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdks-blog/announcing-preview-1-of-net-maui-support-with/ba-p/1160505&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 16:20:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1161660#M10885</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2022-04-06T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1192485#M11138</link>
      <description>&lt;P&gt;Hi Morten,&lt;/P&gt;&lt;P&gt;Wondering if anything in the latest updates might impact iOS showing a MapView.&amp;nbsp; I'm at Visual Studio Version 17.3.0 Preview 3.0 and Runtime&amp;nbsp;100.14.1-preview3.&amp;nbsp; I get a map to show up in Windows but not in iOS 15.5 simulator.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;-Joe&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 15:03:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1192485#M11138</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2022-07-15T15:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code to use MAUI (until official support in ArcGIS Runtime for .NET)</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1192546#M11139</link>
      <description>&lt;P&gt;There's a known issue with the ios simulator in 14.1. Please see the workaround I put here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-net-questions/ios-emulator-with-arcgisruntime-maui-crashes/m-p/1190434/thread-id/11124" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-net-questions/ios-emulator-with-arcgisruntime-maui-crashes/m-p/1190434/thread-id/11124&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 17:50:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/code-to-use-maui-until-official-support-in-arcgis/m-p/1192546#M11139</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2022-07-15T17:50:36Z</dc:date>
    </item>
  </channel>
</rss>

