mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-17 20:35:09 +00:00
Avalonia sample application
This commit is contained in:
parent
f95017bdd3
commit
24b2165d0a
2 changed files with 37 additions and 3 deletions
|
|
@ -1,9 +1,11 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Media;
|
||||
using MapControl;
|
||||
using MapControl.UiTools;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
namespace SampleApplication
|
||||
|
|
@ -70,7 +72,28 @@ namespace SampleApplication
|
|||
|
||||
private void OnMapDoubleTapped(object sender, TappedEventArgs e)
|
||||
{
|
||||
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));
|
||||
if (e.Source == map)
|
||||
{
|
||||
map.TargetCenter = map.ViewToLocation(e.GetPosition(map));
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetHeadingButtonClick(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
map.TargetHeading = 0d;
|
||||
}
|
||||
}
|
||||
|
||||
public class MapHeadingToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return (double)value != 0d;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue