<?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 Basic question: how to copy and paste the sample tools into your own applications? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/basic-question-how-to-copy-and-paste-the-sample/m-p/264832#M6880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi, total newbie here trying my first stab with using the functionality in the samples, and I have a very basic question.&amp;nbsp; The XAML for the various samples, for example the SubLayerList tool I'm trying to add, has a UserControl tag which encloses everything in that application, including the map.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my code-behind (mainPage.xaml.cs), I've added the code displayed for the new SubLayerList class.&amp;nbsp; In my MainPage.xaml, l already have a UserControl declared for the MainPage class which encloses the map, legend, etc.&amp;nbsp;&amp;nbsp; So when I try to add XAML code to create another UserControl for the SubLayerList tool, I get an error in the XAML ("An XML document cannot contain multiple root level elements").&amp;nbsp; When I leave that out, I get errors in the code-behind in the new SubLayerList class definition ("The name 'InitializeComponent' does not exist in the current context").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there someone who can tell me how to resolve this? Thanks for any help..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Feb 2011 17:15:05 GMT</pubDate>
    <dc:creator>DanielSchatt</dc:creator>
    <dc:date>2011-02-22T17:15:05Z</dc:date>
    <item>
      <title>Basic question: how to copy and paste the sample tools into your own applications?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/basic-question-how-to-copy-and-paste-the-sample/m-p/264832#M6880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi, total newbie here trying my first stab with using the functionality in the samples, and I have a very basic question.&amp;nbsp; The XAML for the various samples, for example the SubLayerList tool I'm trying to add, has a UserControl tag which encloses everything in that application, including the map.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my code-behind (mainPage.xaml.cs), I've added the code displayed for the new SubLayerList class.&amp;nbsp; In my MainPage.xaml, l already have a UserControl declared for the MainPage class which encloses the map, legend, etc.&amp;nbsp;&amp;nbsp; So when I try to add XAML code to create another UserControl for the SubLayerList tool, I get an error in the XAML ("An XML document cannot contain multiple root level elements").&amp;nbsp; When I leave that out, I get errors in the code-behind in the new SubLayerList class definition ("The name 'InitializeComponent' does not exist in the current context").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there someone who can tell me how to resolve this? Thanks for any help..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 17:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/basic-question-how-to-copy-and-paste-the-sample/m-p/264832#M6880</guid>
      <dc:creator>DanielSchatt</dc:creator>
      <dc:date>2011-02-22T17:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question: how to copy and paste the sample tools into your own applications</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/basic-question-how-to-copy-and-paste-the-sample/m-p/264833#M6881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When copying and pasting code from the SDK samples onto a new SL app, you only need to replace only the relevant sections.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Replace the following section in your XAML&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
&amp;nbsp;&amp;nbsp;&amp;nbsp; mc:Ignorable="d"
&amp;nbsp;&amp;nbsp;&amp;nbsp; d:DesignHeight="300" d:DesignWidth="400"&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid x:Name="LayoutRoot" Background="White"&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Grid&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with XAML-code from the SubLayerList sample starting from these lines&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
xmlns:esri="http://schemas.esri.com/arcgis/client/2009"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid x:Name="LayoutRoot"&amp;gt;
&amp;lt;!-- more code goes here --&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the code-behind:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Copy and paste code after this line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It may or may not find a few things need to be resolved by a using directive or an assembly reference.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/basic-question-how-to-copy-and-paste-the-sample/m-p/264833#M6881</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T12:57:57Z</dc:date>
    </item>
  </channel>
</rss>

