mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Use C# 7
This commit is contained in:
parent
3ffb613f80
commit
310f0cca9a
21 changed files with 51 additions and 86 deletions
|
|
@ -228,9 +228,7 @@ namespace MapControl
|
|||
element.Height = rect.Height;
|
||||
element.Arrange(rect);
|
||||
|
||||
var rotateTransform = element.RenderTransform as RotateTransform;
|
||||
|
||||
if (rotateTransform != null)
|
||||
if (element.RenderTransform is RotateTransform rotateTransform)
|
||||
{
|
||||
rotateTransform.Angle = parentMap.ViewTransform.Rotation;
|
||||
}
|
||||
|
|
@ -293,9 +291,7 @@ namespace MapControl
|
|||
|
||||
private static void ParentMapPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var mapElement = obj as IMapElement;
|
||||
|
||||
if (mapElement != null)
|
||||
if (obj is IMapElement mapElement)
|
||||
{
|
||||
mapElement.ParentMap = e.NewValue as MapBase;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue