ThinkGeo.com    |     Documentation    |     Premium Support

WpfMapClickEventArgs problem

In winforms, we can determine which mouse key is pressed by doing like this:


private void winformsMap1_MapClick(object sender, WinformsMapClickEventArgs e)


if ((e.Button == MouseButtons.Left)....


 


But in WPF,


private void wpfMap1_MapClick(object sender, WpfMapClickEventArgs e)


if ((e.LeftButton==MouseButtonState.Pressed).....


the above method is not working, the expression "e.LeftButton==MouseButtonState.Pressed" always evaluates to false whenever left mouse button is clicked on the map. May i know what is the proper way to do this?


 


Ric


 



i found a solution, using "wpfMap1_MouseDown(object sender, MouseButtonEventArgs e)", e.GetPosition(wpfMap1).X to get its x andy, then convert to world coordinate using ExtentHelper.ToWorldCoordinate. Sorry for asking. 


Ric, 
  
 Thanks for sharing. Also it reminds me if e.LeftButton is always “Released”, do we really need this property? Any why the winform one works fine but the WPF doesn’t, do we inherit the wrong class. Thanks for letting us know as that’s a chance to make the product being better, I’ve add this in our tracking issue and we will see how to enhance it.  
  
 Thanks, 
  
 Ben