|
POST
|
Finally, I was able to take out the X-axis label, but I couldn't implement a null converter in SL3, because like you said TargetNullValue is available in SL4. Could you explain to me how to do it? You need to combine the dictionary converter (needed with SL3) and the converter returning 0 when null:
public sealed class MyDictionaryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var dict = value as IDictionary<string, object>;
if (dict != null)
{
if (dict.ContainsKey(parameter as string))
return dict[parameter as string];
}
return 0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
What Should I refresh after it? I would say : nothing, should be automatic. Is the slider changing the opacity?
... View more
07-27-2010
02:53 AM
|
0
|
0
|
1977
|
|
POST
|
I get System.ArgumentOutofRange exception at feature = newFeaturelayer.Graphics; Where will be the appropriate place to invoke this function. It means that at this stage the graphics are not existing yet --> call this function after the graphics of your feature layer are loaded. So it's depending on where your graphics are coming from: - if defined in xaml --> call your function in the Initialized event of the feature layer - if defined by code --> call it after this code - if coming from a feature layer --> call it in the UpdateCompleted event ......
... View more
07-27-2010
02:44 AM
|
0
|
0
|
683
|
|
POST
|
See Morten's answer here : http://forums.esri.com/Thread.asp?c=213&f=2455&t=296015 You will need two projects in your solution: One is the Silverlight project, and the other is the website that you will be hosting your silverlight project in. The website must be the startup project. If your Silverlight project is the startup project, the page is run from a file://... URL, instead of http://... Since the map control is talking to REST services hosted on HTTP(S), the silverlight application MUST run under a http:// url. Running as file:// is considered "cross scheme" and is blocked by Silverlight for security reasons. Normally when you create a new Silverlight project, you will be asked if you want to create a website to host it in. Always answer yes to this, and it should be set up automatically (however this might be different in the Express versions though)
... View more
07-26-2010
07:05 AM
|
0
|
0
|
964
|
|
POST
|
I do not want to add query/identify task and get the features and add as a graphic and display on Map. Is this your solution. I was more thinking about an identify task which would be executed on mouse click without adding any graphics. But this don't respect your requirement : 'On mouse hover'. If you really want tooltips, I think the simplest way is you to use a feature layer (just for this polygon layer).
... View more
07-26-2010
06:53 AM
|
0
|
0
|
882
|
|
POST
|
You might use a custom symbol with a text which binds to an attribute. This should be easy for points. More difficult for polylines or polygones because you will have to find the label placement within.
... View more
07-26-2010
06:44 AM
|
0
|
0
|
1495
|
|
POST
|
The sample which looks the closest of what you need is this one : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures Could you give more information about what is not working for you with this sample?
... View more
07-26-2010
06:34 AM
|
0
|
0
|
1212
|
|
POST
|
Duplicate with http://forums.arcgis.com/threads/9001-Clip-and-ship-geoprocessing-service-to-be-utilized-in-silverlight-app
... View more
07-26-2010
06:31 AM
|
0
|
0
|
569
|
|
POST
|
With 10, the geometry service has a new utility method called 'Generalize'. It shoud do the job you are expecting. See sample here : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Generalize
... View more
07-26-2010
06:30 AM
|
0
|
0
|
723
|
|
POST
|
In the same case (kastofan chart) if the value of the field TEL_TOT in the database is null, the application is giving an error (attaching it). Is there a possibility to prevent that? or control it? You could use a null value converter or, with SL 4, use the TargetNullValue binding attribute: <Border.Resources>
<sys:Int32 x:Key="zero">0</sys:Int32>
<ListBox x:Name="Telephones">
<ListBoxItem Content={Binding [TEL_TOT], TargetNullValue={StaticResource zero}}" />
</ListBox>
<ListBox x:Name="Mobiles">
<ListBoxItem Content={Binding [MOB_TOT], TargetNullValue={StaticResource zeo}}" />
</ListBox>
<ListBox x:Name="Internets">
<ListBoxItem Content={Binding [INT_TOT], TargetNullValue={StaticResource zero}}" />
</ListBox>
</Border.Resources>
is there the possibility to take out the number "1" that is in the bottom?, is there a property to configure the x-axis label or something like that? You can make transparent the x-Axis label:
<chartingToolkit:Chart Title="Communication" >
<chartingToolkit:Chart.Axes>
<chartingToolkit:CategoryAxis Orientation="X" Foreground="Transparent" />
</chartingToolkit:Chart.Axes>
....
You can also change the style using Blend.
... View more
07-25-2010
11:30 PM
|
0
|
0
|
3566
|
|
POST
|
I've attached C# code allowing XML serialization/deserialization of Graphics. It's developed as an extension of GraphicsLayer: So, in WPF, you can serialize to a file with code like:
string dataFile = @"graphics.xml";
using (XmlWriter writer = XmlWriter.Create(dataFile, new XmlWriterSettings() { Indent = true }))
{
myGraphicsLayer.SerializeGraphics(writer);
writer.Close();
}
and deserialize with :
myGraphicsLayer.ClearGraphics();
using (XmlReader reader = XmlReader.Create(dataFile))
{
myGraphicsLayer.DeserializeGraphics(reader);
reader.Close();
}
The generated XML looks like:
<?xml version="1.0" encoding="utf-8"?>
<Graphics xmlns:sys="http://www.w3.org/2001/XMLSchema" xmlns:esri="http://schemas.datacontract.org/2004/07/ESRI.ArcGIS.Client.Geometry" xmlns:col="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ESRI.ArcGIS.Client.Samples">
<Graphic>
<Attributes>
<Attribute>
<col:key>OBJECTID</col:key>
<col:value i:type="sys:int">1</col:value>
</Attribute>
<Attribute>
<col:key>Name</col:key>
<col:value i:type="sys:string">Graphic1</col:value>
</Attribute>
</Attributes>
<Geometry i:type="esri:Polygon">
<esri:spatialReference>
<esri:wkid>4326</esri:wkid>
</esri:spatialReference>
<esri:rings>
<esri:points>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>120.039</esri:x>
<esri:y>-20.303</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>142.539</esri:x>
<esri:y>-7.0137</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>163.281</esri:x>
<esri:y>-13.923</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>172.773</esri:x>
<esri:y>-35.174</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>173.594</esri:x>
<esri:y>-43.18</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>121.797</esri:x>
<esri:y>-36.032</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>120.039</esri:x>
<esri:y>-20.303</esri:y>
</esri:point>
</esri:points>
</esri:rings>
</Geometry>
</Graphic>
<Graphic>
<Attributes>
<Attribute>
<col:key>OBJECTID</col:key>
<col:value i:type="sys:int">2</col:value>
</Attribute>
<Attribute>
<col:key>Name</col:key>
<col:value i:type="sys:string">Graphic2</col:value>
</Attribute>
</Attributes>
<Geometry i:type="esri:Polygon">
<esri:spatialReference i:nil="true" />
<esri:rings>
<esri:points>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>130.039</esri:x>
<esri:y>-20.303</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>152.539</esri:x>
<esri:y>-7.0137</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>173.281</esri:x>
<esri:y>-13.923</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>179.773</esri:x>
<esri:y>-35.174</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>179.594</esri:x>
<esri:y>-43.18</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>131.797</esri:x>
<esri:y>-36.032</esri:y>
</esri:point>
<esri:point>
<esri:spatialReference i:nil="true" />
<esri:x>130.039</esri:x>
<esri:y>-20.303</esri:y>
</esri:point>
</esri:points>
</esri:rings>
</Geometry>
</Graphic>
</Graphics>
You can also use it with other kind of stream. Example in silverlight with IsolatedStorage:
string dataFile = @"graphics.xml";
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream fileStream = store.CreateFile(dataFile))
{
using (XmlWriter writer = XmlWriter.Create(fileStream, new XmlWriterSettings() { Indent = true }))
{
graphicsLayer.SerializeGraphics(writer);
writer.Close();
}
fileStream.Close();
}�??
Note that the symbol is not serialized, so it's only working if there is a renderer associted to your layer or if you reset the symbols by code after the deserialization (else the grahics end up wihout any symbol and so are not rendered.
... View more
07-24-2010
05:25 AM
|
1
|
0
|
2247
|
|
POST
|
I attached a tentative of combobox style corresponding to the showcase application. Include it in your resources and use it by setting the combobox style this way:
<ComboBox HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Width="120" Style="{StaticResource ComboBoxShowcaseStyle}" ItemContainerStyle="{StaticResource ComboBoxItemShowcaseStyle}">
.......
... View more
07-24-2010
05:05 AM
|
0
|
0
|
629
|
|
POST
|
With a dynamicServiceLayer, no data are loaded locally. So to display information about the features you will need to query the server. Why not an identify task?
... View more
07-24-2010
04:27 AM
|
0
|
0
|
882
|
|
POST
|
First problem: txtProd is null when I try to add a binding by code. The maptip is not in the same namescope. You should be able to get it by : TextBlock txtBlock = ChartFeaturelayer.MapTip.FindName("txtProd") as TextBlock; Second Problem: If I try creating a new TextBlock instance and changing the binding like this code below, it doesn't work: FeatureLayer ChartFeaturelayer = MyMap.Layers["ChartFL"] as FeatureLayer; ChartFeaturelayer.OutFields.Add("NEWFIELD"]); txtIDChart = new TextBlock(); Binding b = new Binding(""); b.Mode = BindingMode.OneWay; b.ConverterParameter = "NEWFIELD"; txtIDChart.SetBinding(TextBlock.TextProperty, b); You forgot to initialize the converter: b.Converter = new DictionaryConverter(); Note : il you are using SL4, you don't need the dictionary converter anymore:
Binding b = new Binding("[NEWFIELD]");
... View more
07-24-2010
04:24 AM
|
0
|
0
|
3566
|
|
POST
|
I've tested your code, it looks working. The "ESRI Standard Map Application" template is also using ToggleCollapseAction to collapse the main menu and toolbar. Is it working with your version?
... View more
07-24-2010
04:02 AM
|
0
|
0
|
808
|
|
POST
|
As Jennifer mentionned, due to the asynchrone behavior, it might be tricky to know when to reorder the layers. Perhaps you might reverse the process: - declare the layers symchronously (in XAML or in code) in order to control the order - remove the layers when credentials fail Just 2cts (not sure it's ok in your context)
... View more
07-24-2010
03:52 AM
|
0
|
0
|
1796
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2025 03:01 AM | |
| 1 | 10-14-2025 09:24 AM | |
| 1 | 06-13-2013 09:22 AM | |
| 1 | 04-29-2022 02:21 AM | |
| 1 | 04-29-2022 02:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|