Select to view content in your preferred language

Microsoft.Maui.Platform.HandlerNotFoundException: 'Handler not found for view Esri.ArcGISRuntime.Toolkit.Maui.Compass.'

1079
3
Jump to solution
02-22-2024 12:47 PM
FeiyangLuo
New Contributor

mainmapview.xaml

```

<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="iChat.MainMapView"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui"
xmlns:esriTK="clr-namespace:Esri.ArcGISRuntime.Toolkit.Maui;assembly=Esri.ArcGISRuntime.Toolkit.Maui"
xmlns:local="clr-namespace:iChat">

<Grid>
<esriUI:MapView x:Name="ArcGisMapView" Map="{Binding Map}" Margin="0,0,0,-22" IsVisible="{Binding IsMapViewVisible}"/>
<esriUI:SceneView x:Name="ArcGisSceneView" Scene="{Binding Scene}" Margin="0,0,0,-22" IsVisible="{Binding IsSceneViewVisible}"/>
<esriTK:Compass x:Name="MapViewCompass" GeoView="{Binding Source={x:Reference=ArcGisMapView}}" AutoHide="False" />


<!-- 在 Grid 的右上角添加一个切换按钮 -->
<Button Text="{Binding ToggleCommandText}" Command="{Binding ToggleViewCommand}"
HorizontalOptions="End" VerticalOptions="Start"
Margin="0,10,10,0" WidthRequest="60" HeightRequest="30"/>

<!-- 加载动画 -->
<ActivityIndicator x:Name="LoadingIndicator"
IsRunning="{Binding IsLoading}"
IsVisible="{Binding IsLoading}"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand" />
</Grid>
</ContentView>

If I remove line "<esriTK:Compass x:Name="MapViewCompass" GeoView="{Binding Source={x:Reference=ArcGisMapView}}" AutoHide="False" />" , it can  work normally.

 

I already installed the nuget package Esri.ArcGISRuntime.Toolkit.Maui, why  I got this error message:Handler not found for view Esri.ArcGISRuntime.Toolkit.Maui.Compass.

0 Kudos
1 Solution

Accepted Solutions
FeiyangLuo
New Contributor

I solved it, I forgot to add UseArcGISToolkit() in MauiProgram.cs

View solution in original post

3 Replies
FeiyangLuo
New Contributor

I solved it, I forgot to add UseArcGISToolkit() in MauiProgram.cs

dotMorten_esri
Esri Notable Contributor

Glad you figured it out. If you find this step annoying too, please go upvote this issue: https://github.com/dotnet/maui/issues/7258

0 Kudos
dotMorten_esri
Esri Notable Contributor

We're currently experimenting with a code analyzer that'll help remind you to add this call. Would this be helpful?

 

0 Kudos