MouseDown event not working for VisualizationLayer DataTemplate

2 posts, 1 answers
  1. Vincent
    Vincent avatar
    7 posts
    Member since:
    Apr 2015

    Posted 28 Jul 2015 Link to this post

    Hi,

     Hi i am trying to receive the MouseDown event from the local:Marker which I have created using a user control. The MouseDown event will be used to determine when to drag the marker, log other information as well as performing image change.
    I have tested the local:Marker user control without using any telerik codes purely to find out if the MouseDown event works and the result was fine, the user control is able to bubble up the event.

    However when i integrate the user control into the DataTemplate, I was not able to receive any form of MouseDown event. Any explaination or ways to over come this?

     

    <telerik:RadMap x:Name="OsmMap"
    Center="30.335,143.183"
    GeoBoundsNW="85,-180"
    GeoBoundsSE="-85,180"
    ZoomLevel="10"
    TouchDown="OnMap_TouchDown"
    MouseDown="OnMap_OnMouseDown"
    ZoomingFinished="OnMap_ZoomingFinished"
    PanningFinished="OnMap_PanningFinished"
    ZoomChanging="OnMap_ZoomChanging"
    CenterChanging="OnMap_CenterChanging"
    NavigationVisibility="Hidden"
    CommandBarVisibility="Hidden"
    ZoomBarPresetsVisibility="Hidden"
    ZoomBarVisibility="Hidden"
    MiniMapExpanderVisibility="Hidden"
    MouseLocationIndicatorVisibility="Hidden" IsTextSearchCaseSensitive="True">
    <telerik:VisualizationLayer x:Name="MarkerLoaded">
    <telerik:VisualizationLayer.ItemTemplate>
    <DataTemplate>
    <local:Marker telerik:MapLayer.Location="{Binding Location}"
    Latitude="{Binding Latitude, Mode=OneWay}"
    Longitude="{Binding Longitude, Mode=OneWay}"
    CurrentState = "{Binding State, Mode=OneWay}"
    MouseLeftButtonDown="MapWp_MouseDown"
    MouseDown="MapWp_MouseDown"
    PreviewMouseDown="MapWp_MouseDown"
    TouchDown="MapWp_TouchDown">
    <local:Marker/>
    </DataTemplate>
    </telerik:VisualizationLayer.ItemTemplate>
    </telerik:VisualizationLayer>
    </telerik:RadMap>

     

  2. Answer
    Todor
    Admin
    Todor avatar
    168 posts

    Posted 31 Jul 2015 Link to this post

    Hi Vincent,

    I've tried to reproduce the described problem, but to no avail. Mouse events are fired and everything works as expected. I'm not sure what the exact scenario is, but maybe using commands will do the job.

    However, for your convenience I've created a sample demo project which demonstrates the handling for some of the mouse events. You can find it attached. If the problem still exists after that, it will be much easier for us to find what might cause the issue and how to fix it, if you can isolate it in a sample project or modify the sent one in a way the MouseDown event is not fired and send it back to us.

    I hope this helps.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top