<?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: Changing Photos in Code-behind in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355472#M9094</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually got this to work using a different bit of code (as shown below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim photoName As String = selectedFeaturePolling.Attributes.Item("IMAGES")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim uriString As String = String.Format("../PollingPlaces/{0}", photoName)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim photo As Image = New Image
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; photo.Source = New BitmapImage(New Uri(App.Current.Host.Source, uriString))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PollingDialog.PollingPlaceImage.Source = photo.Source&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, while debugging I saw what UriSource was actually being passed in as the image.source.&amp;nbsp; I then realized that my photos folder was not even there...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which brings me to the questions I probably should have asked first.&amp;nbsp; Where in my solution should I save the photos and should I set their build action to "Resources" or "Content"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:39:14 GMT</pubDate>
    <dc:creator>BrianLord1</dc:creator>
    <dc:date>2021-12-11T16:39:14Z</dc:date>
    <item>
      <title>Changing Photos in Code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355470#M9092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I want to be able to change a photo on a usercontrol dialog panel based on the item selected in a separate combo box.&amp;nbsp; Basically, when a user selects an item from the combo box a graphic is added to a graphics layer.&amp;nbsp; From there, I have been able to update all the other text boxes in the form by grabbing the attributes from specified fields for the selected graphic and using them to populate the test properties on the text boxes.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the image, I have been trying to change the source property based on the value in the attribute table for the selected graphic.I have a field (IMAGES) in the layer that contains the names of the image files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code that does not work...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim photoName As String = selectedFeaturePolling.Attributes.Item("IMAGES")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim imageURLstring As String = String.Format("Torrens;component/Images/PollingPlaces/{0}'", photoName)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PollingDialog.PollingPlaceImage.Source = New BitmapImage(New Uri(imageURLstring, UriKind.Relative))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Through the use of message boxes I know that the correct file name is grabbed from the attribute table in the first line and that it is properly added into the URL string on the second line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The third line is where I get lost.&amp;nbsp; I found this example online, but nothing happens when I run this code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 12:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355470#M9092</guid>
      <dc:creator>BrianLord1</dc:creator>
      <dc:date>2012-09-25T12:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Photos in Code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355471#M9093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use GetResourceStream to load an Embedded resource.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-family:Courier New;"&gt;StreamResourceInfo sr = Application.GetResourceStream(new UriString.Format("Torrens;component/Images/PollingPlaces/{0}'", photoName), UriKind.Relative));
 BitmapImage bmp = new BitmapImage();
 bmp.SetSource(sr.Stream);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:39:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355471#M9093</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T16:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Photos in Code-behind</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355472#M9094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I actually got this to work using a different bit of code (as shown below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim photoName As String = selectedFeaturePolling.Attributes.Item("IMAGES")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim uriString As String = String.Format("../PollingPlaces/{0}", photoName)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim photo As Image = New Image
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; photo.Source = New BitmapImage(New Uri(App.Current.Host.Source, uriString))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PollingDialog.PollingPlaceImage.Source = photo.Source&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, while debugging I saw what UriSource was actually being passed in as the image.source.&amp;nbsp; I then realized that my photos folder was not even there...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which brings me to the questions I probably should have asked first.&amp;nbsp; Where in my solution should I save the photos and should I set their build action to "Resources" or "Content"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:39:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/changing-photos-in-code-behind/m-p/355472#M9094</guid>
      <dc:creator>BrianLord1</dc:creator>
      <dc:date>2021-12-11T16:39:14Z</dc:date>
    </item>
  </channel>
</rss>

