Xamarin Forms Map, MoveToRegion in custom event handler not working

BekzodIsakdjanovBekzodIsakdjanov CZMember
edited December 2015 in Xamarin.Forms

Hello everyone,
Can anyone please tell why
works in implemented events, but in a custom control the custom event is fired and the moveToRegion is called but nothing happens.

Here is the part of the XAML layout of control the control

<controls1:CarouselLayout x:Name="CarouselLayout"
                ItemsSource="{Binding Path=Doctors}"
                SelectedItem="{Binding Path=SelectedDoctor}"">
                            Command="{Binding MoveToMapRegionCommand}"
                            CommandParameter="{x:Reference mapa}" />

and in CarouselLayout.cs I declare the event like this
public event EventHandler<SelectedItemChangedEventArgs> SelectionChanged;

and in MoveToMapRegionCommand.cs I execute it like this

     public void Execute(object parameter)
                var Map = (Map) parameter;
                var doctorPos = ViewModel.SelectedDoctor.Address.Position;
                        MapSpan.FromCenterAndRadius(new Position(doctorPos.Latitude - 0.002328, doctorPos.Longtitude),

if subscribe to event for example Focused the same code works
the event is fired properly but moveToRegion as said does not do anything, I believe that the problem is in the signature of my event.
If the code is not enough, please tell me I will post the full code, the reason why I haven't done it is because the post will be too long and redundant code which doesn't affect my problem will be filled all over the place.

Sign In or Register to comment.