<?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: How to customize ArcGIS Maps SDK's Toolkit.Legend for .NET MAUI in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349154#M12306</link>
    <description>&lt;P&gt;For now, I just need to update the font sizes, so I created a custom class that inherits the Legend and makes updates to it this way. Other functionality will be harder to implement but you might be able to use the same inheritance. I'm doing something similar with the SearchView right now and it is proving a bit more challenging.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Toolkit.Maui;

namespace OTISMobile.Helpers
{
	public class CustomLegend : Legend
	{

		protected override void OnBindingContextChanged()
		{
			base.OnBindingContextChanged();

			DataTemplate CustomLayerDataTemplate = new DataTemplate(() =&amp;gt;
				{
					var nameLabel = new Label { FontSize = 32, VerticalOptions = LayoutOptions.Center };
					nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(Layer.Name)}");
					return nameLabel;
				});

			DataTemplate CustomSublayerItemTemplate = new DataTemplate(() =&amp;gt;
			{
				var nameLabel = new Label { FontSize = 28, VerticalOptions = LayoutOptions.Center, Padding = new Thickness(20, 0, 0, 0) };
				nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(ILayerContent.Name)}");
				return nameLabel;
			});

			DataTemplate CustomLegendInfoItemTemplate = new DataTemplate(() =&amp;gt;
			{
				StackLayout sl = new StackLayout() { Orientation = StackOrientation.Horizontal, Padding = new Thickness(20, 0, 0, 0) };
				var symbol = new SymbolDisplay { WidthRequest = 60, HeightRequest = 60, VerticalOptions = LayoutOptions.Center, Margin = new Thickness(0, 0, 5, 0) };
				symbol.SetBinding(SymbolDisplay.SymbolProperty, $"{nameof(LegendEntry.Content)}.{nameof(LegendInfo.Symbol)}");
				sl.Children.Add(symbol);
				var nameLabel = new Label { FontSize = 24, VerticalOptions = LayoutOptions.Center };
				nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(LegendInfo.Name)}");
				sl.Children.Add(nameLabel);
				return sl;
			});

			LayerItemTemplate = CustomLayerDataTemplate;
			LegendInfoItemTemplate = CustomLegendInfoItemTemplate;
			SublayerItemTemplate = CustomSublayerItemTemplate;
		}

	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 14:33:00 GMT</pubDate>
    <dc:creator>SeanS</dc:creator>
    <dc:date>2023-11-14T14:33:00Z</dc:date>
    <item>
      <title>How to customize ArcGIS Maps SDK's Toolkit.Legend for .NET MAUI</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1345519#M12277</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am trying to utilize the ArcGIS Toolkit Legend in .Net Maui as a partial class and update some of the styling of the legend itself but have been unsuccessful thus far. When trying to utilize different parts of the c# code found&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/blob/main/src/Toolkit/Toolkit.Maui/Legend/Legend.cs" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/blob/main/src/Toolkit/Toolkit.Maui/Legend/Legend.cs&lt;/A&gt;&amp;nbsp;I get an error that I cannot use different data types due to their protection level. Has anybody successfully used and updated the toolkit styling (labels and icon location + sizing) without creating a custom Nuget package? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1345519#M12277</guid>
      <dc:creator>SeanS</dc:creator>
      <dc:date>2023-11-06T14:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize ArcGIS Maps SDK's Toolkit.Legend for .NET MAUI</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349133#M12305</link>
      <description>&lt;P&gt;I also have to build a Legend, and found that this one is really not customizable without a fairly significant rewrite. It's on my list of things I have to do.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 13:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349133#M12305</guid>
      <dc:creator>KarenRobine1</dc:creator>
      <dc:date>2023-11-14T13:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize ArcGIS Maps SDK's Toolkit.Legend for .NET MAUI</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349154#M12306</link>
      <description>&lt;P&gt;For now, I just need to update the font sizes, so I created a custom class that inherits the Legend and makes updates to it this way. Other functionality will be harder to implement but you might be able to use the same inheritance. I'm doing something similar with the SearchView right now and it is proving a bit more challenging.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Toolkit.Maui;

namespace OTISMobile.Helpers
{
	public class CustomLegend : Legend
	{

		protected override void OnBindingContextChanged()
		{
			base.OnBindingContextChanged();

			DataTemplate CustomLayerDataTemplate = new DataTemplate(() =&amp;gt;
				{
					var nameLabel = new Label { FontSize = 32, VerticalOptions = LayoutOptions.Center };
					nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(Layer.Name)}");
					return nameLabel;
				});

			DataTemplate CustomSublayerItemTemplate = new DataTemplate(() =&amp;gt;
			{
				var nameLabel = new Label { FontSize = 28, VerticalOptions = LayoutOptions.Center, Padding = new Thickness(20, 0, 0, 0) };
				nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(ILayerContent.Name)}");
				return nameLabel;
			});

			DataTemplate CustomLegendInfoItemTemplate = new DataTemplate(() =&amp;gt;
			{
				StackLayout sl = new StackLayout() { Orientation = StackOrientation.Horizontal, Padding = new Thickness(20, 0, 0, 0) };
				var symbol = new SymbolDisplay { WidthRequest = 60, HeightRequest = 60, VerticalOptions = LayoutOptions.Center, Margin = new Thickness(0, 0, 5, 0) };
				symbol.SetBinding(SymbolDisplay.SymbolProperty, $"{nameof(LegendEntry.Content)}.{nameof(LegendInfo.Symbol)}");
				sl.Children.Add(symbol);
				var nameLabel = new Label { FontSize = 24, VerticalOptions = LayoutOptions.Center };
				nameLabel.SetBinding(Label.TextProperty, $"{nameof(LegendEntry.Content)}.{nameof(LegendInfo.Name)}");
				sl.Children.Add(nameLabel);
				return sl;
			});

			LayerItemTemplate = CustomLayerDataTemplate;
			LegendInfoItemTemplate = CustomLegendInfoItemTemplate;
			SublayerItemTemplate = CustomSublayerItemTemplate;
		}

	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 14:33:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349154#M12306</guid>
      <dc:creator>SeanS</dc:creator>
      <dc:date>2023-11-14T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize ArcGIS Maps SDK's Toolkit.Legend for .NET MAUI</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349401#M12309</link>
      <description>&lt;P&gt;Wow! Nice!!&amp;nbsp; Good way to approach that issue. I was thinking about rewriting it using a MAUI CollectionView, but that might not be the easiest way to deal with it (a complete rewrite).&amp;nbsp; I'll check this code out when I get to that point. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 21:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-customize-arcgis-maps-sdk-s-toolkit-legend/m-p/1349401#M12309</guid>
      <dc:creator>KarenRobine1</dc:creator>
      <dc:date>2023-11-14T21:44:25Z</dc:date>
    </item>
  </channel>
</rss>

