Select to view content in your preferred language

map extent based on window size

1463
9
11-18-2010 05:33 AM
ThaoNguyen
Emerging Contributor
Has anyone set map extent based on window size?  Please share.

Thank you!!
0 Kudos
9 Replies
AliMirzabeigi
Emerging Contributor
You can use Maintain Extent Bahavior if you want to keep your current map extent:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior
0 Kudos
ThaoNguyen
Emerging Contributor
You can use Maintain Extent Bahavior if you want to keep your current map extent:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MaintainExtentBehavior


Thank you!  I tried the sample code, but got the following errors.  I guess the sample code is outdated?

Error 1 The tag 'Interaction.Behaviors' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.

Error 3 The type 'arcgis:MaintainExtentBehavior' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

My code has the namespaces added in the UserControl header as follow:
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:arcgis="http://schemas.esri.com/arcgis/client/2009"

Usage:
<i:Interaction.Behaviors>
        <arcgis:MaintainExtentBehavior x:Uid="meb" />
</i:Interaction.Behaviors>
0 Kudos
AliMirzabeigi
Emerging Contributor
You are missing the following references in your Silverlight application:
System.Windows.Interactivity
ESRI.ArcGIS.Client.Behaviors
0 Kudos
ThaoNguyen
Emerging Contributor
Thank you!  I tried the sample code, but got the following errors.  I guess the sample code is outdated?

Error 1 The tag 'Interaction.Behaviors' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.

Error 3 The type 'arcgis:MaintainExtentBehavior' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

My code has the namespaces added in the UserControl header as follow:
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:arcgis="http://schemas.esri.com/arcgis/client/2009"

Usage:
<i:Interaction.Behaviors>
        <arcgis:MaintainExtentBehavior x:Uid="meb" />
</i:Interaction.Behaviors>


Found 'solution' for error 1 at:
http://stackoverflow.com/questions/3059821/problem-using-blend-3-interaction-behaviours-in-vs2010

But after installing Blend SDK 4, didn't resolve the problem.
0 Kudos
AliMirzabeigi
Emerging Contributor
Did you also add the references I mentioned in my previous post (#4)?
0 Kudos
ThaoNguyen
Emerging Contributor
Did you also add the references I mentioned in my previous post (#4)?


Just read your reply after I posted mine.  Yeah, that resolved the problem.  The sample code doesn't have those, but it references the url.  I removed the url lines and added the assembly references instead.  Thanks!!!
0 Kudos
ThaoNguyen
Emerging Contributor
Did you also add the references I mentioned in my previous post (#4)?


ahhhh, still cannot try the sample solution.  I got assembly Interactivity below even though it's there in my references of the project.  I'm not sure what dependencies are missing either.

"Could not load file or assembly 'System.Windows.Interactivity, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."
0 Kudos
JenniferNery
Esri Regular Contributor
In your project references, does it show a warning symbol (!) next to the System.Windows.Interactivity? Can you check that when this assembly is selected the proper file path is located? Go to the path and see if the file exists (Kindly see attached).

Installing Blend 4, should have updated your registry so that these assemblies are found when you add reference to .NET assembly.
0 Kudos
ThaoNguyen
Emerging Contributor
In your project references, does it show a warning symbol (!) next to the System.Windows.Interactivity? Can you check that when this assembly is selected the proper file path is located? Go to the path and see if the file exists (Kindly see attached).

Installing Blend 4, should have updated your registry so that these assemblies are found when you add reference to .NET assembly.


There is no exclamation mark beside the dll reference and I also checked the path.  Everything is correct.  I also installed Blend 4 SDK.  Thanks for trying to help me!
0 Kudos