|
POST
|
Task.WaitAll(task1); When the code reaches "Task.WaitAll(task1);" line, I wait for ever; Your call to WaitAll is blocking the UIThread and as SimplifyAsync is an asynchronous method which needs the UIThread, you are stuck. It's exactly what the new C# 'await' operator is done for : i.e. to use asynchonous task without blocking the thread. That being said, .Net Framework 4.0 and SL5 doesn't support the 'await' operator except if you download and install the Async Targetting Pack Without this pack, you can get the same behavior by using the ContinueWith method. Something like: Task<IList<Graphic>> task1 = geometryService.SimplifyTask(PstLayer.Graphics);
task1.ContinueWith(t =>
{
IList<Graphic> simplifiedPstLayer = t.Result;
// add here your code using the simplified graphics
}, TaskScheduler.FromCurrentSynchronizationContext());
// No more code here
Obviously the syntaxic sugar of the await operator gets lost. Note : another option would be to execute your task in another thread, but in this particular case it's not working since the graphics need to be created in the UIThread and so SymplifyAsync can only be executed in the UI Thread.
... View more
10-05-2012
12:22 AM
|
0
|
0
|
795
|
|
POST
|
At first glance I don't see anything wrong in your code. Could you use fiddler to look at the Relationship request sent to the server? That might give a clue.
... View more
10-04-2012
11:54 PM
|
0
|
0
|
474
|
|
POST
|
Ok , done that. But Now I want to turn on / off several sublayers within a Map service layers from the TOC. I can check/uncheck the button, but it does not change the visibility of the layer. If your map service is cached, you can't change the visibility of the sublayers. The reason being that the image are pregenerated at the server side with the visibilities defined by the service. The workaround might be either to create a non cached service or to create one cached service by layer (or by group of layers you want to manage together). Though, both solutions have performance impacts.
... View more
10-04-2012
09:27 AM
|
0
|
0
|
1513
|
|
POST
|
Hi Dan, I have no direct answer to your quetion but I can just explain some points you highlighted: I'm really in the dark here and I don't even understand what this "End" refers to in the Binding or how to use it. DataContext="{Binding ElementName=CurrentTimeSlider, Path=Value}" The datacontext of your stack panel is set to the 'Value' property of the TimeSlider. This property is documented here. As you can see in the doc, this property is of type TimeExtent which has 2 properties of type DateTime: Start and End. So that explains why a binding such as <TextBlock Text="{Binding End}" FontSize="12" /> works and displays the end time of the timeslider current position (if your time slider is in 'Instant Mode' the start time will always be equal to the end time). That explains also your result: Do I type "{Binding End.Test}"? Or "{Binding Test}"? Or "{Binding [Test]}"? etc. I've tried all these and they don't work. You can't change that easily the existing types : TimeExtent and DateTime 🙂 (though you can change the display format as I explained in my first post) So if you want to display new properties in the timeslider, one option is to create you own timeslider control subclassing the toolkit timeslider and add in this control the dependency properties you need (as I did in the sample I pointed out) That being said, in your case, I am not sure you need to subclass the timeslider. The info you need to display doesn't seem related to the time slider (it's more an info coming from service) and you are trying to display it outside of the timeslider. So, at first glance, I would say that you could: - create a dependency property 'Test' in your user control - set this property with the value coming from your service (tho not sure how since it's depending on your context and I don't know much about mosaic dataset). - bind a textblock inside your usercontrol to this dependency property Hope this helps
... View more
10-04-2012
09:21 AM
|
0
|
0
|
1198
|
|
POST
|
Did you look at this http://forums.arcgis.com/threads/14730-Area-And-Perimeter ?
... View more
10-03-2012
10:49 PM
|
0
|
0
|
1340
|
|
POST
|
centerAndZoom(MyMap,selectedFeature,1200); error : cannot convert mapPoint You didn't give any info about the mapPoint variable in your post. Though I guess selectedFeature is a graphic and can't be casted to a MapPoint, should likely be: centerAndZoom(MyMap,selectedFeature.Geometry as MapPoint,1200)
... View more
10-03-2012
10:44 PM
|
0
|
0
|
1873
|
|
POST
|
You can create new features by code. there is a sample here : http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#AddGraphics To store them in the GDB, you need to set up a feature server and allow editing for this server. But there is nothing specific because the user enters the coordinates manually. There are editing samples here : http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#EditToolsAutoSave
... View more
10-03-2012
10:42 PM
|
0
|
0
|
766
|
|
POST
|
You can format the string in your binding statement. Something like: Text="{Binding End, StringFormat='{}{0:yyyy}'" You can also do it by code for adjusting the format to the most significative format. I did it it this sample .
... View more
10-03-2012
10:37 PM
|
0
|
0
|
1198
|
|
POST
|
The Checkbox on the TOC module is not working <CheckBox Content="{Binding Label}" IsChecked="{Binding IsEnable, Mode=TwoWay}" IsEnabled="{Binding IsInScaleRange,Mode=TwoWay}" IsHitTestVisible="False" VerticalAlignment="Center"/> Setting IsHitTestVisible to false prevents any input from the mouse or the keyboard. Set it to true or keep the default value instead.
... View more
10-03-2012
10:31 PM
|
0
|
0
|
1513
|
|
POST
|
Is your issue due to the statistics or to your geometry? In others words, if you make a simple spatial query with your geometry as filter and without any statistics, does your query return any features?
... View more
10-01-2012
11:55 PM
|
0
|
0
|
839
|
|
POST
|
do you mean that if you don't call 'graphicslayer.refresh()', your symbol change is not immediatly taken into account?
... View more
10-01-2012
11:52 PM
|
0
|
0
|
973
|
|
POST
|
MyFDG.Resources["SeeRelateButton"].Visibility = Visibility.Visible; ???????????????? As Hyrum noticed, you can't change a Template this way. But if your Handler 'SeeRelateButton_Click' is called, why not just change the visibility in the Handler (by using the 'sender ' argument)?
... View more
10-01-2012
11:47 PM
|
0
|
0
|
811
|
|
POST
|
The performances by using a featureLayer (in snapshot mode) or by using a query should be very close (and likely identical). Using a FeatureLayer is effectively better because you get the symbology coming from the server. In your case, the performance are likely different because you are using the 'OnDemand' mode. With this mode a query is sent for every zoom or pan. If your number of features (after filtering) is not too high (i.e < a few 1000s), you can use the snapshot mode. In this mode only one query will be sent and performances will be better.
... View more
10-01-2012
11:42 PM
|
0
|
0
|
1904
|
|
POST
|
In this thread, there is a centerAndZoom function that should do the job.
... View more
10-01-2012
11:32 PM
|
0
|
0
|
1873
|
| 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
|