<?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 where to put the &amp;amp;amp;quot;Code Behind C#&amp;amp;amp;quot; code? in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605997#M3115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. I'm using Microsoft Expression Blend to work with the ArcGIS SDK for WPF, and I'm a bit new to both. I have been trying to integrate some of the interactive samples in the "ArcGIS API for Silverlight" section into my code, and I am a bit confused about where to put the code in the "Code Behind C#" tab of those samples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More specifically, I know how to find the code-behind files for MainWindow and App (and my various user controls), but I'm not sure in which of those I should put the code-behind from the sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, this is the code-behind for the ElementLayer sample (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ElementLayer):"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ElementLayer):&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]using System.Windows;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using System.Windows.Controls;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;namespace ArcGISSilverlightSDK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT] public partial class ElementLayer : UserControl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp; public ElementLayer()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [INDENT]InitializeComponent();[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; private void RedlandsButton_Click(object sender, RoutedEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [INDENT]MessageBox.Show("You found Redlands");[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT] }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found through trial and error that I don't put all of that in MainWindow.xaml.cs. Rather, it seems that I need to include just the RedlandsButton_Click method to get things to work. But does that mean I can ignore the rest of the C# code, or do I need to put it elsewhere?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any tips, or a point toward some relevant documentation, would be appreciated. Thanks much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2012 13:08:48 GMT</pubDate>
    <dc:creator>MichaelStiso</dc:creator>
    <dc:date>2012-08-14T13:08:48Z</dc:date>
    <item>
      <title>where to put the &amp;amp;quot;Code Behind C#&amp;amp;quot; code?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605997#M3115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. I'm using Microsoft Expression Blend to work with the ArcGIS SDK for WPF, and I'm a bit new to both. I have been trying to integrate some of the interactive samples in the "ArcGIS API for Silverlight" section into my code, and I am a bit confused about where to put the code in the "Code Behind C#" tab of those samples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;More specifically, I know how to find the code-behind files for MainWindow and App (and my various user controls), but I'm not sure in which of those I should put the code-behind from the sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, this is the code-behind for the ElementLayer sample (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ElementLayer):"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ElementLayer):&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]using System.Windows;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using System.Windows.Controls;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;namespace ArcGISSilverlightSDK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT] public partial class ElementLayer : UserControl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&amp;nbsp; public ElementLayer()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [INDENT]InitializeComponent();[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; private void RedlandsButton_Click(object sender, RoutedEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [INDENT]MessageBox.Show("You found Redlands");[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT] }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found through trial and error that I don't put all of that in MainWindow.xaml.cs. Rather, it seems that I need to include just the RedlandsButton_Click method to get things to work. But does that mean I can ignore the rest of the C# code, or do I need to put it elsewhere?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any tips, or a point toward some relevant documentation, would be appreciated. Thanks much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 13:08:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605997#M3115</guid>
      <dc:creator>MichaelStiso</dc:creator>
      <dc:date>2012-08-14T13:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: where to put the "Code Behind C#" code?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605998#M3116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;Hi there!&lt;BR /&gt;&lt;BR /&gt;MainWindow.xaml.cs is most likely correct palace but some things to note:&lt;BR /&gt;&lt;BR /&gt;In your case, you can just copy needed code to code-behind after the MainWindow's Constructor&lt;BR /&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;private void RedlandsButton_Click(object sender, RoutedEventArgs e)&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;{&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;MessageBox.Show("You found Redlands");&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&lt;BR /&gt;After that you codebehind shoud look more or less like this (just writing out from my head)&lt;BR /&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;public partial class MainWindow : Window&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;
&lt;/SPAN&gt;{
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3e3e3e; font-family: Arial;"&gt;public MainWindow()
&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();
&lt;/SPAN&gt;&lt;SPAN style="color: #3e3e3e; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;rivate void RedlandsButton_Click(object sender, RoutedEventArgs e)&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;MessageBox.Show("You found Redlands");&lt;/SPAN&gt;
&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&lt;BR /&gt;In Wpf, you are using Window control instead of the UserControl so in the code behind &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;public partial class ElementLayer : UserControl&lt;/SPAN&gt;&lt;/PRE&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt; &lt;BR /&gt;Here ElementLayer defines the name of the class that should be in your case MainWindow. If you are using Window as your control base, then UserControl should be Window.&lt;BR /&gt;&lt;BR /&gt;I would say that follow more ArcGIS Runtime for WPF 1.0 samples that you can find from your computer after you have installed Runtime development tools:&lt;BR /&gt;Start -&amp;gt; All Programs -&amp;gt; ArcGIS -&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;Runtime SDK 1.0 for WPF -&amp;gt;ArcGIS Runtime WPF Samples 1.0 &lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605998#M3116</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2021-12-12T01:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: where to put the "Code Behind C#" code?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605999#M3117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great, that clears up a bit. Thanks much for the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 10:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/where-to-put-the-amp-amp-quot-code-behind-c-amp/m-p/605999#M3117</guid>
      <dc:creator>MichaelStiso</dc:creator>
      <dc:date>2012-08-15T10:06:56Z</dc:date>
    </item>
  </channel>
</rss>

