POST
|
Sorry, I understand my mistake, I misspoke. SketchEditor.CompleteCommand.CanExecute runs in an other method. When CanExecute runs, StartAsync isn't finished. I want to detect when CanExecute is true before the end of StartAsync.
... View more
03-10-2020
09:53 AM
|
0
|
1
|
540
|
POST
|
When we clicked, they are many action that take in place. These actions are not launched simultaneously. So there is an order of execution. This order is : - ICommand (Visibility) - GeoViewTapped - The point is drawn The point is drawn after all the other actions. That's the problem.
... View more
03-10-2020
09:04 AM
|
0
|
3
|
540
|
POST
|
I tried your method but the order of runs don't change. With breakpoint, I see the Icommand runs before drawing modify. It's the same problem. Here is my updated code: <AppBarButton Margin="0,0,-15,0"
Command="{Binding ValiderTraceCommand}"
Icon="Accept"
Label="Valider le tracé"
Style="{StaticResource DefaultAppBarButtonStyle}"
Visibility="{Binding ValiderTraceCommandIsVisible, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" Width="100" FontSize="10"/> public bool ValiderTraceCommandIsVisible
{
get
{
return MapView.SketchEditor.CompleteCommand.CanExecute(null);
}
}
... View more
03-10-2020
02:21 AM
|
0
|
5
|
540
|
POST
|
Sorry, I d'on't see how explain. I have a hidden button and I want to alter his visibility. At begin, button are hidden. Next, we start drawing. When at least one point is drawn, I want the button to appear. The visibility depends on the drawing but also on another variable, so a "Binding" is not enough. The real problem is the order of execution, when we clicked on the map, the GeoViewTapped event runs before the new point of the drawing. Since I check the visibility in this event, I'm always one point behind. When I draw the 2nd point, my check only detects the first point. Same with more points.
... View more
03-09-2020
01:12 AM
|
0
|
7
|
540
|
POST
|
Yes, the line after the initialisation runs when the drawing is complete but I want to run drawing test before the end of the drawing. That is why I use GeoViewTapped. I want to check that the drawing can be completed before it is complete.
... View more
03-06-2020
01:04 AM
|
0
|
9
|
1565
|
POST
|
Thanks for your answers, but it's not exactly that. You'll find my code below to better understand. In Xaml : <AppBarButton Margin="0,0,-15,0"
Command="{Binding ValiderTraceCommand}"
Icon="Accept"
Label="Valider le tracé"
Style="{StaticResource DefaultAppBarButtonStyle}"
Visibility="{Binding ValiderTraceCommandIsVisible, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"
Width="100"
FontSize="10"/> <Border Grid.Column="1"
BorderBrush="Gray"
BorderThickness="1,0,0,0">
<esriControls:MapView x:Name="mapView"
Map="{Binding Map}" Loaded="mapView_Loaded">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="GeoViewTapped">
<core:InvokeCommandAction Command="{Binding OnMapViewTappedCommand}" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</esriControls:MapView>
</Border> In View : public bool ValiderTraceCommandIsVisible
{
get
{
return ValiderTraceCommand.CanExecute(null);
}
}
public RelayCommand ValiderTraceCommand
{
get
{
return _validerTraceCommand ?? (_validerTraceCommand = new RelayCommand(async () => await ValiderTrace(), CanValiderTrace));
}
}
private async Task ValiderTrace()
{
if (MapView.SketchEditor.CompleteCommand.CanExecute(null))
{
MapView.SketchEditor.CompleteCommand.Execute(null);
}
}
private Boolean CanValiderTrace()
{
return MapView.SketchEditor.CompleteCommand.CanExecute(null) && otherVariable;
}
public RelayCommand<object> OnMapViewTappedCommand
{
get
{
return _onMapViewTappedCommand ??
(_onMapViewTappedCommand =
new RelayCommand<object>(async mapView => await OnMapViewTapped(mapView)));
}
}
private async Task OnMapViewTapped(object mapViewInputEventArgs)
{
ValiderTraceCommand.RaiseCanExecuteChanged();
RaisePropertyChanged(() => ValiderTraceCommandIsVisible);
} SketchEditor is initialized by : Geometry g = await MapView.SketchEditor.StartAsync(SketchCreationMode.Polygon, true); Here's the problem, when I click on the map, OnMapViewTapped runs before drawing. Therefore, during the third point creation, my test detect only two point. Always one point behind. How can I launch this test after the drawing ?
... View more
03-05-2020
06:20 AM
|
0
|
0
|
1565
|
POST
|
What I want to do is very simple. If any geometry is created, then my button is visible. My button is here to validate the draw. I need to detect that the drawing can be completed. -If SketchEditor initialized but no drawing, then button "Validate" hidden -If SketchEditor.Command.canComplete then button "Validate" visible
... View more
02-28-2020
05:29 AM
|
0
|
0
|
1565
|
POST
|
Thanks for your answer. My real problem is the order of event execution. After a click, the MapView Tapped event is detected before the geometry creation. So, I don't know how control future geometry because it doesn't yet exist. Do you know how to reverse the order of execution of events?
... View more
02-27-2020
12:26 AM
|
0
|
2
|
1565
|
POST
|
Hi everyone, I've a problem with drawing on map on ArcGIS SDK 100.7 for .NET. I'm using SketchEditor and I need to configure visibility of a button with SketchEditor.CompleteCommand.CanExecute. My problem is that the execution of my test is always done before the drawing. Sequence step by step : - //Step 1 - Geometry g = await MapView.SketchEditor.StartAsync(SketchCreationMode.Point, true); //Async method - MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return false - //Step 2 : Click on the map - MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return false - //The 1st drawing appears on the map - //Step 3 : Click on the map - MapView.SketchEditor.CompleteCommand.CanExecute(null); //Return true but detect only 1st point instead of 1st & 2nd. - //The 2nd drawing appears on the map My goal is to detect the first point into my first control. The difficult is my initialisation are asynchrone, but my control is synchrone. I tried to pass the 2 asynchronously but the error is still present. Currently, my button appears when creating the 2nd point. I have the same problem for polylines and polygons. My button appears at the 3rd point for my polyline, and at my 4th point for my polygon. There is always a point of delay. Have you got any idea? Thank you
... View more
02-26-2020
01:08 AM
|
0
|
18
|
2270
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|