<?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: Binding to Envelope parameters on ZoomToAction in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53090#M1385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unfortunately these Envelope properties (XMin, YMin, XMax, YMax) are not dependency properties that's why you cannot bind to them.&lt;BR /&gt;&lt;BR /&gt;Jennifer&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to extend the Envelope class to include properties (like a wrapper) that are dependency properties?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

public static readonly DependencyProperty BindableXMaxProperty = 
&amp;nbsp;&amp;nbsp;&amp;nbsp; DependencyProperty.Register(
&amp;nbsp;&amp;nbsp;&amp;nbsp; "BindableXMax", typeof(Double),
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...&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; );
public double BindableXMax
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Double)GetValue(BindableXMax);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; set
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.XMax = value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetValue(BindableXMaxProperty, value);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know what you think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:02:35 GMT</pubDate>
    <dc:creator>MichaelLibio</dc:creator>
    <dc:date>2021-12-10T22:02:35Z</dc:date>
    <item>
      <title>Binding to Envelope parameters on ZoomToAction</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53087#M1382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm creating a series of bookmarks with the names and extents of the bookmarks being bound to an external XML file.&amp;nbsp; I've added the XML as a date source in Expression Blend.&amp;nbsp; I've got a listbox like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;ListBox x:Name="Bookmarklistbox" ItemTemplate="{StaticResource bookmarkTemplate}" ItemsSource="{Binding categoryCollection}" &amp;gt;
&amp;lt;/ListBox&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've put the ItemTemplate in the UserControl resources and it looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;DataTemplate x:Key="bookmarkTemplate"&amp;gt;
&amp;lt;StackPanel&amp;gt;
&amp;lt;TextBlock Text="{Binding name}"/&amp;gt;
&amp;lt;Button Name="bookmarkbutton" /&amp;gt;
&amp;lt;i:Interaction.Triggers&amp;gt;
&amp;lt;i:EventTrigger EventName="Click"&amp;gt;
&amp;lt;esriBehaviors:ZoomToAction TargetName="Map"&amp;gt;
&amp;lt;esriBehaviors:ZoomToAction.Geometry&amp;gt;
&amp;lt;esriGeometry:Envelope
XMin="{Binding XMin}" YMin="{Binding YMin}" XMax="{Binding XMax}" YMax="{Binding YMax}"/&amp;gt;
&amp;lt;/esriBehaviors:ZoomToAction.Geometry&amp;gt;
&amp;lt;/esriBehaviors:ZoomToAction&amp;gt;
&amp;lt;/i:EventTrigger&amp;gt;
&amp;lt;/i:Interaction.Triggers&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, The button content shows up as it should with the correct bookmark name.&amp;nbsp; However, I can't get the Envelope parameters to bind without an error.&amp;nbsp; The error I'm receiving is "Object of System.Windows.Data.Binding cannot be converted to System.Double"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I switch the button content to {Binding XMin}, the content changes to a coordinate...so I know I'm in the right neighborhood.&amp;nbsp; But, I can't seem to figure out how to bind this correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 18:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53087#M1382</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-07-29T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Binding to Envelope parameters on ZoomToAction</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53088#M1383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately these Envelope properties (XMin, YMin, XMax, YMax) are not dependency properties that's why you cannot bind to them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jennifer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 03:15:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53088#M1383</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-07-30T03:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Binding to Envelope parameters on ZoomToAction</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53089#M1384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah - I see.&amp;nbsp; Thanks for filling me in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a workaround (if anyone is interested).&amp;nbsp; First I changed my XML.&amp;nbsp; Where there were 4 properties(Xmin, Ymin,Xmax,Ymax) for each entry before, there is a single comma-delimited string now.&amp;nbsp; I can bind that to the button.tag in the data template and parse that string in code behind on the button's click event handler.&amp;nbsp; Then I create a new envelope, and pass the parsed string parts to the bounding box coordinates of the new envelope.&amp;nbsp; Finally, I call Map.ZoomTo(mynewenv) and it works. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 12:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53089#M1384</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-07-30T12:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Binding to Envelope parameters on ZoomToAction</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53090#M1385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unfortunately these Envelope properties (XMin, YMin, XMax, YMax) are not dependency properties that's why you cannot bind to them.&lt;BR /&gt;&lt;BR /&gt;Jennifer&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to extend the Envelope class to include properties (like a wrapper) that are dependency properties?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

public static readonly DependencyProperty BindableXMaxProperty = 
&amp;nbsp;&amp;nbsp;&amp;nbsp; DependencyProperty.Register(
&amp;nbsp;&amp;nbsp;&amp;nbsp; "BindableXMax", typeof(Double),
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...&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; );
public double BindableXMax
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Double)GetValue(BindableXMax);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; set
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.XMax = value;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetValue(BindableXMaxProperty, value);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know what you think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:02:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-to-envelope-parameters-on-zoomtoaction/m-p/53090#M1385</guid>
      <dc:creator>MichaelLibio</dc:creator>
      <dc:date>2021-12-10T22:02:35Z</dc:date>
    </item>
  </channel>
</rss>

