mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-07 01:00:43 +01:00
Use lambda discard parameters
This commit is contained in:
parent
301ebacc58
commit
29ccf656cd
|
|
@ -63,7 +63,7 @@ namespace MapControl
|
||||||
loadingProgress = new Progress<double>(p => SetValue(LoadingProgressProperty, p));
|
loadingProgress = new Progress<double>(p => SetValue(LoadingProgressProperty, p));
|
||||||
|
|
||||||
updateTimer = new UpdateTimer { Interval = UpdateInterval };
|
updateTimer = new UpdateTimer { Interval = UpdateInterval };
|
||||||
updateTimer.Tick += async (s, e) => await UpdateImageAsync();
|
updateTimer.Tick += async (_, _) => await UpdateImageAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace MapControl
|
||||||
loadingProgress = new Progress<double>(p => SetValue(LoadingProgressProperty, p));
|
loadingProgress = new Progress<double>(p => SetValue(LoadingProgressProperty, p));
|
||||||
|
|
||||||
updateTimer = new UpdateTimer { Interval = UpdateInterval };
|
updateTimer = new UpdateTimer { Interval = UpdateInterval };
|
||||||
updateTimer.Tick += (s, e) => UpdateTiles();
|
updateTimer.Tick += (_, _) => UpdateTiles();
|
||||||
#if WPF
|
#if WPF
|
||||||
RenderOptions.SetEdgeMode(this, EdgeMode.Aliased);
|
RenderOptions.SetEdgeMode(this, EdgeMode.Aliased);
|
||||||
#elif UWP || WINUI
|
#elif UWP || WINUI
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ namespace MapControl
|
||||||
// Workaround for missing property value inheritance.
|
// Workaround for missing property value inheritance.
|
||||||
// Loaded and Unloaded handlers set and clear the ParentMap property value.
|
// Loaded and Unloaded handlers set and clear the ParentMap property value.
|
||||||
//
|
//
|
||||||
element.Loaded += (s, e) => GetParentMap((FrameworkElement)s);
|
element.Loaded += (_, _) => GetParentMap(element);
|
||||||
element.Unloaded += (s, e) => ((FrameworkElement)s).ClearValue(ParentMapProperty);
|
element.Unloaded += (_, _) => element.ClearValue(ParentMapProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MapBase GetParentMap(FrameworkElement element)
|
public static MapBase GetParentMap(FrameworkElement element)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace MapControl
|
||||||
|
|
||||||
Content = grid;
|
Content = grid;
|
||||||
|
|
||||||
SizeChanged += (s, e) => path.Data = BuildGeometry();
|
SizeChanged += (_, _) => path.Data = BuildGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
public UIElement Child
|
public UIElement Child
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ namespace MapControl.UiTools
|
||||||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
|
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
|
||||||
};
|
};
|
||||||
|
|
||||||
Loaded += (s, e) => Initialize();
|
Loaded += (_, _) => Initialize();
|
||||||
Click += (s, e) => Execute();
|
Click += (_, _) => Execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace MapControl.UiTools
|
||||||
Styles.Add(style);
|
Styles.Add(style);
|
||||||
|
|
||||||
Flyout = new MenuFlyout();
|
Flyout = new MenuFlyout();
|
||||||
Loaded += async (s, e) => await Initialize();
|
Loaded += async (_, _) => await Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Icon
|
public string Icon
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace MapControl.UiTools
|
||||||
#if WPF
|
#if WPF
|
||||||
link.ToolTip = uri.ToString();
|
link.ToolTip = uri.ToString();
|
||||||
|
|
||||||
link.RequestNavigate += (s, e) =>
|
link.RequestNavigate += (_, e) =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ namespace MapControl.UiTools
|
||||||
{
|
{
|
||||||
protected MapMenuItem()
|
protected MapMenuItem()
|
||||||
{
|
{
|
||||||
Loaded += (s, e) => Initialize();
|
Loaded += (_, _) => Initialize();
|
||||||
Click += (s, e) => Execute();
|
Click += (_, _) => Execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ namespace MapControl.UiTools
|
||||||
public MenuButton()
|
public MenuButton()
|
||||||
{
|
{
|
||||||
ContextMenu = new ContextMenu();
|
ContextMenu = new ContextMenu();
|
||||||
DataContextChanged += (s, e) => ContextMenu.DataContext = e.NewValue;
|
DataContextChanged += (_, e) => ContextMenu.DataContext = e.NewValue;
|
||||||
Loaded += async (s, e) => await Initialize();
|
Loaded += async (_, _) => await Initialize();
|
||||||
Click += (s, e) => ContextMenu.IsOpen = true;
|
Click += (_, _) => ContextMenu.IsOpen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Icon
|
public string Icon
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,13 @@ namespace MapControl.UiTools
|
||||||
{
|
{
|
||||||
protected MapMenuItem()
|
protected MapMenuItem()
|
||||||
{
|
{
|
||||||
Loaded += (s, e) =>
|
Loaded += (_, _) =>
|
||||||
{
|
{
|
||||||
ParentMenuItems = ((Panel)VisualTreeHelper.GetParent(this)).Children.OfType<MapMenuItem>().ToList();
|
ParentMenuItems = ((Panel)VisualTreeHelper.GetParent(this)).Children.OfType<MapMenuItem>().ToList();
|
||||||
Initialize();
|
Initialize();
|
||||||
};
|
};
|
||||||
|
|
||||||
Click += (s, e) => Execute();
|
Click += (_, _) => Execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IList<MapMenuItem> ParentMenuItems { get; private set; }
|
protected IList<MapMenuItem> ParentMenuItems { get; private set; }
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace MapControl.UiTools
|
||||||
public MenuButton()
|
public MenuButton()
|
||||||
{
|
{
|
||||||
Flyout = new MenuFlyout();
|
Flyout = new MenuFlyout();
|
||||||
Loaded += async (s, e) => await Initialize();
|
Loaded += async (_, _) => await Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Icon
|
public string Icon
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue