Toolbar icons are not visible

803
5
10-12-2010 08:59 AM
SteveMaskol
New Contributor III
I copied the XAML code and code behind into VS 2008 for the ArcGIS Silverlight sample that uses the Toolkit's Toolbar control to navigate over the map (Zoom In, Zoom Out, Pan, etc.) The only problem is the icons contained in the toolbar are not visible when I run the application. I created an Assets folder and in that folder created an Images folder which is where the images used for the toolbar are stored which is like what is used in the sample. Unfortunately, that does not seem to be recognized as a valid image source. When I test the application, the map is visible but the toolbar is empty. None of the icons are displayed. How do you get the icons to display in an esriToolbar?
0 Kudos
5 Replies
JMcNeil
Occasional Contributor III
Did you create the folder in explore or in VS?  When you are in VS and click on the folder do you see the icons listed?  If not right click on the folder in VS and select Add......Existing Item....Browse to the icons.  Also in your XAML code is the folder path correct? Maybe something like this  <Image Source="Images/Question.png" Margin="2" />

Also are you using the 2.0 API, I thought VS 2010 was required but not sure.

J
0 Kudos
SteveMaskol
New Contributor III
I am using the 1.x version of the API with VS 2008. I created the folder in Visual Studio and I do see the icon files. My XAML code is set up the same way as the sample. For example, the images source for the Zoom In toolbar item is as follows.

<Image Source="Assets/Images/i_zoomin.png"  Stretch="UniformToFill" Margin="5" />

This is the same as the sample code. The Assest/Images file is located in the ClientBin folder. Is this the correct place? I only put it there because I saw it done on another thread when I did a search for my problem. I am a virtual novice when it comes to Silverlight so I bet there is an easy fix but I just can't find the solution.
0 Kudos
JMcNeil
Occasional Contributor III
Steve,

What sample are you referring too?

Why are using 1.x, I would grab 2.0
Go here to find all you need: http://help.arcgis.com/en/webapi/silverlight/help/index.html?Expression_Getting_Started.htm

Visual Web Developer Express 2010 is free and it has everything you need.  Blend is nice but you only can get it on a 60 day trail but really Visual Web Developer Express 2010 is all you need.

Check out this to get started http://help.arcgis.com/en/webapi/silverlight/help/index.html?Expression_Getting_Started.htm

And then I would probably simply just grab a template and go from there.  At that point you can see how everything is laid out and called.
http://help.arcgis.com/en/webapi/silverlight/samples/TemplateGalleryWeb/start.htm


installing 2.0 will also install the basic template and showcase template in VS.  Just make sure to install VS before the api.....follow the order in the download page. 


Sorry I couldn't help.  Maybe if you point me to your example. 

P.S. my application doesn't have an Assets folder so I don't think that is your problem.
0 Kudos
SteveMaskol
New Contributor III
Is 2.0 compatible with Visual Studio 2008? We have not yet moved to Visual Studio 2010.

The sample I am referring to comes from the ArcGIS API for Microsoft Silverlight - Interactive Samples page.

http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm

The sample is called Toolbar and can be found under Toolkit on the left side of the page.
0 Kudos
JenniferNery
Esri Regular Contributor
If you choose to set Image Source the same way as the sample: "Assets/images/i_zoomout.png", you need to have Assets folder created from VisualStudio. Right-click on the project to Add > New Folder and name it "Assets", and then create "images" sub-folder by right-clicking on "Assets" folder, you should then have your PNG files added here by right-clicking on "images" (Add > Existing Item).

If doing this still does not work, try changing Image Source to "/YourAssemblyName;component/Assets/images/i_zoomout.png"

If you need to stick to VS2008, then you can use ArcGIS API for SL/WPF v1.2.
0 Kudos