mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Avalonia sample application
This commit is contained in:
parent
c2a5394d8e
commit
d2c3382f46
5 changed files with 141 additions and 14 deletions
|
|
@ -5,6 +5,7 @@ using System.Globalization;
|
|||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SampleApplication
|
||||
|
|
@ -61,7 +62,7 @@ namespace SampleApplication
|
|||
{
|
||||
var location = map.ViewToLocation(e.GetPosition(map));
|
||||
|
||||
if (location != null)
|
||||
if (location != null && map.CaptureMouse())
|
||||
{
|
||||
measurementLine.Visibility = Visibility.Visible;
|
||||
measurementLine.Locations = new LocationCollection(location);
|
||||
|
|
@ -70,6 +71,7 @@ namespace SampleApplication
|
|||
|
||||
private void MapMouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
map.ReleaseMouseCapture();
|
||||
measurementLine.Visibility = Visibility.Collapsed;
|
||||
measurementLine.Locations = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue