Improve touch input handling

This commit is contained in:
ClemensFischer 2022-11-12 11:08:10 +01:00
parent 7448daa531
commit 47a96b22cc
4 changed files with 17 additions and 47 deletions

View file

@ -149,8 +149,15 @@ namespace MapControl
}
else if (Children.Count == 0)
{
Children.Add(new Image { Opacity = 0d, Stretch = Stretch.Fill });
Children.Add(new Image { Opacity = 0d, Stretch = Stretch.Fill });
for (int i = 0; i < 2; i++)
{
Children.Add(new Image
{
Opacity = 0d,
Stretch = Stretch.Fill,
IsHitTestVisible = false // avoid touch capture issues
});
}
}
base.SetParentMap(map);

View file

@ -52,7 +52,7 @@ namespace MapControl
new PropertyMetadata(TimeSpan.FromSeconds(0.2), (o, e) => ((MapTileLayerBase)o).updateTimer.Interval = (TimeSpan)e.NewValue));
public static readonly DependencyProperty UpdateWhileViewportChangingProperty = DependencyProperty.Register(
nameof(UpdateWhileViewportChanging), typeof(bool), typeof(MapTileLayerBase), new PropertyMetadata(false));
nameof(UpdateWhileViewportChanging), typeof(bool), typeof(MapTileLayerBase), new PropertyMetadata(true));
public static readonly DependencyProperty MapBackgroundProperty = DependencyProperty.Register(
nameof(MapBackground), typeof(Brush), typeof(MapTileLayerBase), new PropertyMetadata(null));

View file

@ -43,7 +43,12 @@ namespace MapControl
}
}
public Image Image { get; } = new Image { Opacity = 0d, Stretch = Stretch.Fill };
public Image Image { get; } = new Image
{
Opacity = 0d,
Stretch = Stretch.Fill,
IsHitTestVisible = false // avoid touch capture issues
};
public bool Pending { get; set; } = true;