<?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: Help with BasemapItemTemplate Table of Contents in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14546#M184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd assume that works. Did you check the output window for any binding errors? That should give you a hint why the binding isn't working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;we can assume there is only one&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is definitely a big assumption. A lot of the basemaps also have reference layers (ie labels).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the sample which uses the context menu to&amp;nbsp;completely replace the basemap.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-toolkit-dotnet/blob/master/src/Samples/Toolkit.SampleApp.WPF/Samples/ToC/TableOfContentsSample.xaml.cs#L39-L53" title="https://github.com/Esri/arcgis-toolkit-dotnet/blob/master/src/Samples/Toolkit.SampleApp.WPF/Samples/ToC/TableOfContentsSample.xaml.cs#L39-L53"&gt;arcgis-toolkit-dotnet/TableOfContentsSample.xaml.cs at master · Esri/arcgis-toolkit-dotnet · GitHub&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;That might give you additional ideas how to handle this (like setting the basemap to null&amp;nbsp;or&amp;nbsp;empty).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally the basemap was designed to be operated on as a whole. I guess it would have been useful to also have&amp;nbsp; a Visibility property on the basemap as a whole.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Apr 2020 19:45:22 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2020-04-23T19:45:22Z</dc:date>
    <item>
      <title>Help with BasemapItemTemplate Table of Contents</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14545#M183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the new version of the TableOfContents it no longer uses the common&amp;nbsp;LiyerList.&amp;nbsp; This approach the basemap behaved similar to the OperationalLayer and both would have a check box.&amp;nbsp; With the new design there is a TocItem.Content which differs for Basemap layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This uses&amp;nbsp;the&amp;nbsp;BasemapItemTemplate and I see where this could be adjusted.&amp;nbsp; Adding a check box isn't an issue but the issue is how would I tie the checkbox to the actual BaseLayer (we can assume there is only one).&amp;nbsp; I tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;Grid&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Margin&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;0,2&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
		&amp;lt;Grid.ColumnDefinitions&amp;gt;
			&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;ColumnDefinition&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Width&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Auto&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
			&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;ColumnDefinition&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Width&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;*&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
		&amp;lt;/Grid.ColumnDefinitions&amp;gt;
		&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;CheckBox&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;IsChecked&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;{Binding Content.BaseLayers[0].IsVisible, Mode&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;TwoWay}&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;&amp;lt;!--&amp;lt;CheckBox.Style&amp;gt;
				&amp;lt;Style TargetType="CheckBox"&amp;gt;
					&amp;lt;Style.Triggers&amp;gt;
						&amp;lt;DataTrigger Binding="{Binding Content.CanChangeVisibility, Mode=OneTime}" Value="False"&amp;gt;
							&amp;lt;Setter Property="Visibility" Value="Collapsed" /&amp;gt;
						&amp;lt;/DataTrigger&amp;gt;
					&amp;lt;/Style.Triggers&amp;gt;
				&amp;lt;/Style&amp;gt;
			&amp;lt;/CheckBox.Style&amp;gt;--&amp;gt;&lt;/SPAN&gt;
		&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;CheckBox&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
		&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;TextBlock&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Text&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;{Binding Content.Name, Mode&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;OneWay}&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Grid.Column&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;1&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;VerticalAlignment&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Center&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;Grid&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to find something showing how to bind to a specific item in the ItemsSource without any luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3050" target="_blank"&gt;Morten Nielsen&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14545#M183</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-10T20:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with BasemapItemTemplate Table of Contents</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14546#M184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd assume that works. Did you check the output window for any binding errors? That should give you a hint why the binding isn't working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;we can assume there is only one&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is definitely a big assumption. A lot of the basemaps also have reference layers (ie labels).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the sample which uses the context menu to&amp;nbsp;completely replace the basemap.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-toolkit-dotnet/blob/master/src/Samples/Toolkit.SampleApp.WPF/Samples/ToC/TableOfContentsSample.xaml.cs#L39-L53" title="https://github.com/Esri/arcgis-toolkit-dotnet/blob/master/src/Samples/Toolkit.SampleApp.WPF/Samples/ToC/TableOfContentsSample.xaml.cs#L39-L53"&gt;arcgis-toolkit-dotnet/TableOfContentsSample.xaml.cs at master · Esri/arcgis-toolkit-dotnet · GitHub&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;That might give you additional ideas how to handle this (like setting the basemap to null&amp;nbsp;or&amp;nbsp;empty).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally the basemap was designed to be operated on as a whole. I guess it would have been useful to also have&amp;nbsp; a Visibility property on the basemap as a whole.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2020 19:45:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14546#M184</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2020-04-23T19:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with BasemapItemTemplate Table of Contents</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14547#M185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess should have been:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I can assume&amp;nbsp;there is only one (because I know how the map is loaded in this application)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My attempt did not work, using the Binding to BaseLayers[0].&amp;nbsp; I'll look at the sample, for now I hold the BaseLayer and just turn on off in event handlers, which works.&amp;nbsp; I would like to do in the template though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ToggleButton_OnChecked&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; RoutedEventArgs e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	_baseLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsVisible &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ToggleButton_OnUnchecked&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; RoutedEventArgs e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	_baseLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsVisible &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:35:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/help-with-basemapitemtemplate-table-of-contents/m-p/14547#M185</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-10T20:35:20Z</dc:date>
    </item>
  </channel>
</rss>

