|
POST
|
Setting a Width to your TextBox should force the Text to wrap to multi lines when the text length is greater than the textbox width.
... View more
07-17-2012
11:36 PM
|
0
|
0
|
3783
|
|
POST
|
Ohh yes. Looks like I got lost between C# and VB syntax. Sorry about that.
... View more
07-17-2012
11:34 PM
|
0
|
0
|
1847
|
|
POST
|
That might be a scale range matter if a scale range is defined at the server side for the feature layer. Try by setting IgnoreServiceScaleRange to true (false is the default).
... View more
07-17-2012
01:50 PM
|
0
|
0
|
837
|
|
POST
|
To remove all credentials generated during the session: foreach (IdentityManager.Credential crd in ESRI.ArcGIS.Client.IdentityManager.Current.Credentials) ESRI.ArcGIS.Client.IdentityManager.Current.RemoveCredential(crd); To remove a specific credential for a service: IdentityManager.Credential crd = ESRI.ArcGIS.Client.IdentityManager.Current.FindCredential(url); ESRI.ArcGIS.Client.IdentityManager.Current.RemoveCredential(crd);
... View more
07-17-2012
09:53 AM
|
0
|
0
|
757
|
|
POST
|
The syntax to wire up an handler to an event is '+=' not '=' featureLayer.UpdateCompleted += Sub(snd, evt) ......
... View more
07-17-2012
09:46 AM
|
0
|
0
|
1847
|
|
POST
|
You can use ArcGISDynamicMapServiceLayer.CreateDynamicLayerInfosFromLayerInfos in order to get the renderers defined at the server side. Using that as starting point will avoid you to create class breaks renderer by code.
... View more
07-17-2012
09:41 AM
|
0
|
0
|
2684
|
|
POST
|
Thanks for the replies. I tried changing that property but unfortunately it does not help me.If the layer is removed from the Legend, it was not getting added back when it was again made visible. If you are using the option 'ShowOnlyVisibleLayers' and that a layer is removed from the legend because the layer is no more visible (for example because you zoom out of the scale range), the layer should automatically show up again in the legend when the layer is again made visible. Could you give a sample to reproduce this issue? Also, I noticed that the LayerItemViewModel class returns strange values for certain properties.e.g. If the layer is out of visible scale range, it should return false for the property IsInScaleRange.But every time, it returns true.Same is the case for IsVisible and IsMapLayer. Not sure about the strange values you noticed but these points might explain your results: IsInScaleRange is always true if there is no minimum scale or maximum scale defined for the layer or the sublayer. IsMapLayer is always true for the main layers (i.e the layers declared in the map). It's false for the sublayers of an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer. IsVisible should be false if your layer or sublayer is not visible (if the layer visibility has been set to false or if IsInScaleRange is false) You will find more explanations about these properties in the documentation.
... View more
07-17-2012
03:34 AM
|
0
|
0
|
2184
|
|
POST
|
I eventually got it:) Looks like you are in a case between rFlat' and 'Tree'. After further investigations, my suggestion to do it by code on event Legend.Refreshed is not working because we can't remove the map layers from the legend (else the legend won't be updated when layer or sublayers visibility change). The workaround might be to change the legend template and start the treeview hierarchy one level down.
<esri:Legend.Template>
<ControlTemplate TargetType="esri:Legend"
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:sdk="clr-namespace:System.Windows;assembly=System.Windows.Controls">
<toolkit:TreeView ItemsSource="{Binding LayerItemsSource[0].LayerItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" >
<toolkit:TreeView.ItemTemplate>
<sdk:HierarchicalDataTemplate ItemsSource="{Binding LayerItemsSource}" >
<ContentPresenter Content="{Binding}" ContentTemplate="{Binding Template}" />
</sdk:HierarchicalDataTemplate>
</toolkit:TreeView.ItemTemplate>
<toolkit:TreeView.ItemContainerStyle>
<Style TargetType="toolkit:TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
</Style>
</toolkit:TreeView.ItemContainerStyle>
</toolkit:TreeView>
</ControlTemplate></esri:Legend.Template> Note how is set the ItemsSource of the TreeView : ItemsSource="{Binding LayerItemsSource[0].LayerItemsSource, RelativeSource={RelativeSource TemplatedParent}} Instead of starting the treeview hierarchy from LayerItemsSource, we start it from the sublayers of the first layer (that supposes there is only one layer in the legend but it's your case). Hope this helps.
... View more
07-17-2012
03:14 AM
|
0
|
0
|
5762
|
|
POST
|
Issue #1: Look at the attached image. I need the groups : USAID-related, Political/Administrative, Infrastructure, Israel-related to behave like TreeView (i.e. collapse/visible). Only the root element: USAID_Layers is redundant. I understood that. But please try the Flat mode which looks to me a better starting point for your need. You have just to change LayerItemsMode="Flat" in your XAML code.
... View more
07-17-2012
12:55 AM
|
0
|
0
|
5762
|
|
POST
|
:)Thank you very very much for both Nathalie and Dominique. It's great topic. And i was wondered if i can show the chart at the same place of the selected polygon . If you need one chart by polygon we might look at that sample that may be closer of your need. Here we display only one chart showing all graphics or group of graphics in the same chart. I am not sure it makes sense that this chart overrides the selected graphics. But anyway it could be done by setting the position of the chart by code instead of using a fixed position (to do each time the selection changes). Another, if you can explain this object: DataContext = graphicsLayer.Graphics.GroupBy(graphic => (string)graphic.Attributes["NAME"], (subregion, graphics) => new AttributeGroup { Key = subregion, Count = graphics.Count(), Sum = graphics.Select(g => (int)g.Attributes["ELEVATION"]).Sum(), Graphics = graphics }).ToArray(); NAME being an unique identifier, a group by NAME is not the best sample since it's just returning the complete list of graphics. The initial sample was: // Group by sub region
Groups1 = graphicsLayer.Graphics.GroupBy(graphic => (string)graphic.Attributes["SUB_REGION"],
(key, graphics) => new AttributeGroup
{
Key = key,
Count = graphics.Count(),
Sum = graphics.Select(g => (int)g.Attributes["POP2000"]).Sum(),
Graphics = graphics
}).ToArray();
Here we group the graphics by SUB_REGION (by using the keySelector : (string)graphic.Attributes["SUB_REGION"]) and for each SUB_REGION we return an AttributeGroup containing mainly the SubRegion (Key) and the population of the subregion (Sum). This list of AttributGroup is used as ItemsSource for the chart with the SubRegion as independent value and the population as dependent value. So we get a chart showing the population by subregion. Hope this helps.
... View more
07-17-2012
12:10 AM
|
0
|
0
|
2144
|
|
POST
|
From API version 3.0 and server 10.1, you can change the symbology dynamically (if the functionality has been enabled at the server side). There is a sample here : http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#DynamicLayer Using that, you might change by code the symbology depending on the layers that are turned on (though will need some development)
... View more
07-16-2012
11:42 PM
|
0
|
0
|
2684
|
|
POST
|
Intersect REST API is working with the geometries only. The attributes are not sent to the server (and so are not returned). However the Intersect API returns all geometries in the same order than the input geometries (the geometries that don't intersect having a null extent). So you should be able to retrieve the attributes from the input graphics.
... View more
07-16-2012
11:37 PM
|
0
|
0
|
918
|
|
POST
|
Hi Dominique, As to issue #1, I thought to do it in Legend.Refreshed event but I didn't know how to catch the root element in order to remove it. I need to remove it, not to collapse it. As to issue #2, I will check it. Do you have a sample of changing LegendItemTemplate ? I looked at your wonderful site (http://broux.dominique.free.fr/Silverlight/InteractiveSDK/Default.htm#LegendTOC) but couldn't find one. Thanks a lot, Miri Issue#1 : I still don't understand why 'Flat' mode is not working for you. Issue#2 : Example of LegendItemTemplate skrinking the spaces between items and displaying image after the text:
<esri:Legend.LegendItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,-3">
<TextBlock Text="{Binding Label}" Margin="5,0" VerticalAlignment="Center" MinWidth="80" />
<Image Source="{Binding ImageSource}" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" MinWidth="20" Margin="0,-1" />
</StackPanel>
</DataTemplate>
</esri:Legend.LegendItemTemplate>
... View more
07-16-2012
11:03 PM
|
0
|
0
|
5762
|
|
POST
|
I agree with you that might be a built in function but strangly it's the first time I heard about such need. Anyway, nice customization. Thanks for sharing your code.
... View more
07-16-2012
10:47 PM
|
0
|
0
|
3724
|
|
POST
|
Likely there is a syntax error in your code. You should be able to wire up an handler to the event UpdateCompleted. How does your code look?
... View more
07-16-2012
10:40 PM
|
0
|
0
|
1847
|
| 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
|