<?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 MaintainExtentBehavior problem in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35678#M941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to use MaintainExtentBehavior but got the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A value of type 'MaintainExtentBehavior' cannot be added to a collection or dictionary of type 'BehaviorCollection'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;i:Interaction.Behaviors&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriBehaviors:MaintainExtentBehavior x:Uid="meb" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/i:Interaction.Behaviors&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My namespaces:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; xmlns:esriBehaviors="clr-namespace:ESRI.ArcGIS.Client.Behaviors;assembly=ESRI.ArcGIS.Client.Behaviors"&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clues why I got that error??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jan 2011 18:36:24 GMT</pubDate>
    <dc:creator>ThaoNguyen</dc:creator>
    <dc:date>2011-01-07T18:36:24Z</dc:date>
    <item>
      <title>MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35678#M941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to use MaintainExtentBehavior but got the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A value of type 'MaintainExtentBehavior' cannot be added to a collection or dictionary of type 'BehaviorCollection'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;i:Interaction.Behaviors&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriBehaviors:MaintainExtentBehavior x:Uid="meb" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/i:Interaction.Behaviors&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My namespaces:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; xmlns:esriBehaviors="clr-namespace:ESRI.ArcGIS.Client.Behaviors;assembly=ESRI.ArcGIS.Client.Behaviors"&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any clues why I got that error??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 18:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35678#M941</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-01-07T18:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35679#M942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kindly look at the SDK sample for MaintainExtentBehavior &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message in your other post seem related to this. In both cases you were using "x:Uid".&amp;nbsp; Have you tried compiling your app without this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jan 2011 03:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35679#M942</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-01-09T03:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35680#M943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kindly look at the SDK sample for MaintainExtentBehavior &lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The error message in your other post seem related to this. In both cases you were using "x:Uid".&amp;nbsp; Have you tried compiling your app without this?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Our application requires x:uid; otherwise, it won't compile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To me, x:uid should not affect this, if it does, it doesn't make sense.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 13:48:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35680#M943</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-01-10T13:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35681#M944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe the error is unrelated to "x:Uid" then. Have you tried the recreating SDK sample? Was the issue related to xaml namespace definition or referencing the correct assemblies?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you just need to update this line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The type mismatch may be caused by this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's more information about the error you got: &lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/bb546975(v=VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb546975(v=VS.100).aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 13:51:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35681#M944</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-01-10T13:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35682#M945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Maybe the error is unrelated to "x:Uid" then. Have you tried the recreating SDK sample? Was the issue related to xaml namespace definition or referencing the correct assemblies?&lt;BR /&gt;&lt;BR /&gt;I think you just need to update this line.&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The type mismatch may be caused by this. &lt;BR /&gt;&lt;BR /&gt;Here's more information about the error you got: &lt;A href="http://msdn.microsoft.com/en-us/library/bb546975(v=VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb546975(v=VS.100).aspx&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't try the sample itself, I just learn how it is done and do it in my own application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;changing the xmlns as you suggested didn't resolve the problem either :(.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 14:28:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35682#M945</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-01-10T14:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35683#M946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't see why you would get this error message. I found this related thread: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/3323-SL4-Breaks-ESRI-Behaviors"&gt;http://forums.arcgis.com/threads/3323-SL4-Breaks-ESRI-Behaviors&lt;/A&gt;&lt;SPAN&gt; Can you try adding the behavior in code-behind? Both methods should work actually (XAML / code-behind).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 15:39:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35683#M946</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-01-10T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35684#M947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't see why you would get this error message. I found this related thread: &lt;A href="http://forums.arcgis.com/threads/3323-SL4-Breaks-ESRI-Behaviors"&gt;http://forums.arcgis.com/threads/3323-SL4-Breaks-ESRI-Behaviors&lt;/A&gt; Can you try adding the behavior in code-behind? Both methods should work actually (XAML / code-behind).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just come back to this issue.&amp;nbsp; I think the sample xaml code posted is not correct.&amp;nbsp; The MaintainExtentBehavior class does not exist in Arcgis client dll.&amp;nbsp; It is in ESRI.ArcGIS.Client.Behaviors.dll.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't got this worked yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I follow the sample, I got an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;The tag 'Interaction.Behaviors' does not exist in XML namespace '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/expression/2010/interactivity" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/expression/2010/interactivity&lt;/A&gt;&lt;SPAN&gt;'. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried the code behind but I got a compilation error because the version of the System.interactivity.dll did not match (as below).&amp;nbsp; I installed expression4 and hoping it would provide me System.interactivity.dll version 4, but it was version 3.5.&amp;nbsp; I'm not sure what to do now.&amp;nbsp; Can't find where I can get version 4, can't try the sample xaml code either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Assembly 'ESRI.ArcGIS.Client.Behaviors, Version=2.1.0.446, Culture=neutral, PublicKeyToken=29c6dd6e8553d944' uses 'System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Windows.Interactivity, Version=3.5.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 12:24:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35684#M947</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-01-24T12:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35685#M948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the SDK sample is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using VS 2010 with SL API v2.1? If so, the following is supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://schemas.esri.com/arcgis/client/2009" 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any public XAML-able properties that belong to esri namespace, except for the Primitives can be accessed through namespace as long as you have reference to their assemblies. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This means you still need to add reference to ESRI.ArcGIS.Client.Behavior.dll in your project in order to do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;esri:MaintainExtentBehavior .../&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now that you mentioned the error message, I think the issue is resolving this namespace and adding reference to the correct version in your project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An older may have been installed and it picks up the older version, you can try to add hint path as described here &lt;/SPAN&gt;&lt;A href="http://forums.silverlight.net/forums/p/194833/453085.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.silverlight.net/forums/p/194833/453085.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:23:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35685#M948</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T21:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35686#M949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I think the SDK sample is correct.&lt;BR /&gt;&lt;BR /&gt;Are you using VS 2010 with SL API v2.1? If so, the following is supported&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://schemas.esri.com/arcgis/client/2009" 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Any public XAML-able properties that belong to esri namespace, except for the Primitives can be accessed through namespace as long as you have reference to their assemblies. &lt;BR /&gt;&lt;BR /&gt;This means you still need to add reference to ESRI.ArcGIS.Client.Behavior.dll in your project in order to do the following:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;esri:MaintainExtentBehavior .../&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Now that you mentioned the error message, I think the issue is resolving this namespace and adding reference to the correct version in your project.&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;An older may have been installed and it picks up the older version, you can try to add hint path as described here &lt;A href="http://forums.silverlight.net/forums/p/194833/453085.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.silverlight.net/forums/p/194833/453085.aspx&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using VS 2010 with WPF API v2.1.&amp;nbsp; I already tried what you suggested above except the hint path, nothing worked :(.&amp;nbsp; Will try to add hint path when I have a chance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:23:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35686#M949</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2021-12-10T21:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35687#M950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've never got MaintainExtentBehavior worked for my &lt;/SPAN&gt;&lt;STRONG&gt;WPF &lt;/STRONG&gt;&lt;SPAN&gt;application.&amp;nbsp; I wonder if this function only works for Silverlight?&amp;nbsp; Am I right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I no longer get compiled errors as mentioned in this original post, but got an error at runtime as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was because I added &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;i:Interaction.Behaviors&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriBehaviors:MaintainExtentBehavior x:Uid="meb" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/i:Interaction.Behaviors&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I removed the xaml code and tried to add the code below to the behind code as suggested, I didn't get runtime error but the map extent just didn't change when I resized my window.&amp;nbsp; It didn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Windows.Interactivity.Behavior behavior = new ESRI.ArcGIS.Client.Behaviors.MaintainExtentBehavior();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Windows.Interactivity.Interaction.GetBehaviors(MyMap).Add(behavior);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 17:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35687#M950</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-04-13T17:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: MaintainExtentBehavior problem</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35688#M951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've never got MaintainExtentBehavior worked for my &lt;STRONG&gt;WPF &lt;/STRONG&gt;application.&amp;nbsp; I wonder if this function only works for Silverlight?&amp;nbsp; Am I right?&lt;BR /&gt;I no longer get compiled errors as mentioned in this original post, but got an error at runtime as below:&lt;BR /&gt;A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll&lt;BR /&gt;&lt;BR /&gt;This was because I added &lt;BR /&gt;&amp;lt;i:Interaction.Behaviors&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriBehaviors:MaintainExtentBehavior x:Uid="meb" /&amp;gt;&lt;BR /&gt;&amp;lt;/i:Interaction.Behaviors&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I removed the xaml code and tried to add the code below to the behind code as suggested, I didn't get runtime error but the map extent just didn't change when I resized my window.&amp;nbsp; It didn't work.&lt;BR /&gt;&lt;BR /&gt;System.Windows.Interactivity.Behavior behavior = new ESRI.ArcGIS.Client.Behaviors.MaintainExtentBehavior();&lt;BR /&gt;System.Windows.Interactivity.Interaction.GetBehaviors(MyMap).Add(behavior);&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried a simple map application, it worked fine!&amp;nbsp; Don't know what may cause the problem I have.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 18:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintainextentbehavior-problem/m-p/35688#M951</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2011-04-13T18:38:11Z</dc:date>
    </item>
  </channel>
</rss>

