|
POST
|
Hi Ryan, The SL framework is not using the CLR accessor, so it's normal that your break points in get/set are never used. What you could test is to define a callback on the property changed and try to put a break point at this level. Something like: //Members - Dependency Properties
protected static readonly DependencyProperty dependencyPropertyMap = DependencyProperty.Register("Map", typeof(Map), typeof(DataToolbar), new PropertyMetadata(null, OnMapChanged));
private static void OnMapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ // put a break point here
}
//Properties
public Map Map
{
get { return (Map)GetValue(dependencyPropertyMap); }
set { SetValue(dependencyPropertyMap, value); }
}
Hopefully this will help.
... View more
05-19-2010
05:27 AM
|
0
|
0
|
3682
|
|
POST
|
I did some additional tests and I was able to reproduce the issue when the DP is initialized with a binding. Is it your case? In this case, the DP is initialized after the Loaded event (if the control is visible), and so if the loaded event put the visibility to collapsed, the DP is not initialized. This behavior doesn't look tie to the Window Panel but more general to the Loaded event with Silverlight. I found an article (http://bryantlikes.com/FakingTheInitializedEventInSilverlight.aspx) which is suggesting to use the dispatcher in the constructor. If we change the visibility this way, the DP are initialized (in the cases I tested...) public MainPage()
{
InitializeComponent();
Dispatcher.BeginInvoke(Initialized);
}
private void Initialized()
{
MyControl.Visibility = Visibility.Collapsed;
} Note that another workaround could be you to change the Opacity instead of the Visibility. Keep your control visible but with an opacity of 0. So the DP are initialized and when your control is ready, you can set the opacity to 1.0.
... View more
05-19-2010
05:14 AM
|
0
|
0
|
568
|
|
POST
|
A Question just in case: Isn't your DataToolbar collapsed?
... View more
05-18-2010
09:56 AM
|
0
|
0
|
3682
|
|
POST
|
You have to deal with the order of the layers in the LayerCollection Map.Layers. I have no code to provide, but as a LayerCollection is also implementing ICollection and IList, it should be easy to change the order.
... View more
05-18-2010
09:50 AM
|
0
|
0
|
383
|
|
POST
|
In the example, the datacontext of each item is the layer itself (it's why we can display the name, change the opacity....). So if you add a 'Delete' button, you have to write a code like: private void ButtonDelete_Click(object sender, System.Windows.RoutedEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
this.MyMap.Layers.Remove(element.DataContext as Layer);
} The layer will be removed from the map and the button/checkbox/slider will be removed automatically as well (thanks to the SL/WPF binding). Concerning your question about the layer removal through XAML, I don't think you can do that out of the box.
... View more
05-18-2010
09:41 AM
|
0
|
0
|
1488
|
|
POST
|
Something simple like: double ratio = 200/200.5;
p2.X = p1.X + ratio * (p2.X-p1.X);
p2.Y = p1.Y + ratio * (p2.Y-p1.Y);
or do you need to deal with geodesic precision?
... View more
05-18-2010
05:18 AM
|
0
|
0
|
231
|
|
POST
|
In this case, you can no more take advantage of the existing collection 'QueryTask.LastResults.Features'. You have to manage yourself a collection of graphics. When you get the result of a query, depending on your need, you can append/replace/combine/clear the collection.
... View more
05-18-2010
05:09 AM
|
0
|
0
|
681
|
|
POST
|
As your control is not visible, it's not loaded. You might try by making it visible and by collapsing it when loaded. Example in XAML: <i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<ei:ChangePropertyAction PropertyName="Visibility">
<ei:ChangePropertyAction.Value>
<Visibility>Collapsed</Visibility>
</ei:ChangePropertyAction.Value>
</ei:ChangePropertyAction>
</i:EventTrigger>
</i:Interaction.Triggers>
... View more
05-17-2010
06:58 AM
|
0
|
0
|
568
|
|
POST
|
Remove the layer from the layer collection associated to the map. Something like: myMap.Layers.Remove(myLayer);
... View more
05-15-2010
02:50 AM
|
0
|
0
|
1488
|
|
POST
|
Which version of API are you working with? I forgot to mention that LayerInfo property was only existing from version 2.0. Links to documentation: LayerInfo property : http://help.arcgis.com/en/webapi/silverlight/apiref/topic316.html FeatureLayerInfo members : http://help.arcgis.com/en/webapi/silverlight/apiref/topic342.html If you are using the version 2.0 and don't get any description for your feature layer, check that your service is giving such information. Example of service giving a description and a copyright : http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0?f=pjson
... View more
05-14-2010
02:43 AM
|
0
|
0
|
504
|
|
POST
|
The extension method 'ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(this ESRI.ArcGIS.Client.Geometry.MapPoint)' should be helpful. /Dominique
... View more
05-13-2010
09:39 AM
|
0
|
0
|
1921
|
|
POST
|
For a featureLayer, Description and CopyrightText are given by the property layerInfo. A tooltip like: <ToolTipService.ToolTip>
<StackPanel MaxWidth="400">
<TextBlock FontWeight="Bold" Text="{Binding CopyrightText}" TextWrapping="Wrap" />
<TextBlock FontWeight="Bold" Text="{Binding LayerInfo.CopyrightText}" TextWrapping="Wrap" />
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
<TextBlock Text="{Binding LayerInfo.Description}" TextWrapping="Wrap" />
</StackPanel>
</ToolTipService.ToolTip> should work in this case. /Dominique
... View more
05-13-2010
09:36 AM
|
0
|
0
|
504
|
|
POST
|
Get the rings of the polygon, each ring is a collection of point. For example, to get the points of the first ring of your polygon, you can use : ESRI.ArcGIS.Client.Geometry.PointCollection points = myPolygon.Rings[0]; /Dominique
... View more
05-13-2010
02:43 AM
|
0
|
0
|
595
|
|
POST
|
Looks working for me with something like : <Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="10" ></RowDefinition>
<RowDefinition Height="*" ></RowDefinition>
<RowDefinition Height="30" ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<!-- Map Control -->
<esri:Map x:Name="Map" Background="White" Grid.Row="1" Grid.Column="1">
.......
Rows/Columns 0 and 2 have fixed sizes and the map in row 1/Column 1 is using the remaining space. /Dominique
... View more
05-13-2010
02:37 AM
|
0
|
0
|
421
|
|
POST
|
You are getting the same error than if your feature layer URL was incorrect. Verify what you get if you execute a query on your feature layer URL. With the sample, you get this : http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0?f=pjson (pjson = format pretty json to be more readable). /Dominique
... View more
05-13-2010
02:32 AM
|
0
|
0
|
1188
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 09-07-2021 03:12 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|