Update comments

This commit is contained in:
ClemensFischer 2022-11-30 22:18:45 +01:00
parent 9db1987ee5
commit 754e185c5d
20 changed files with 83 additions and 48 deletions

View file

@ -40,7 +40,9 @@ namespace MapControl
{
using (var stream = new MemoryStream(buffer))
{
return await LoadImageAsync(stream); // await before closing stream
// Must await method before closing the stream.
//
return await LoadImageAsync(stream);
}
}

View file

@ -58,7 +58,9 @@ namespace MapControl
{
var point = e.GetCurrentPoint(this);
mouseWheelDelta += point.Properties.MouseWheelDelta / 120d; // standard mouse wheel delta
// Standard mouse wheel delta value is 120.
//
mouseWheelDelta += point.Properties.MouseWheelDelta / 120d;
if (Math.Abs(mouseWheelDelta) >= 1d)
{

View file

@ -56,7 +56,8 @@ namespace MapControl
public MapBase()
{
// set Background by Style to enable resetting by ClearValue in MapLayerPropertyChanged
// Set Background by Style to enable resetting by ClearValue in MapLayerPropertyChanged.
//
var style = new Style(typeof(MapBase));
style.Setters.Add(new Setter(BackgroundProperty, new SolidColorBrush(Colors.White)));
Style = style;

View file

@ -57,13 +57,16 @@ namespace MapControl
if (parentMap != null)
{
// If this.Background is not explicitly set, bind it to parentMap.Background
// If this.Background is not explicitly set, bind it to parentMap.Background.
//
this.SetBindingOnUnsetProperty(BackgroundProperty, parentMap, Panel.BackgroundProperty, nameof(Background));
// If this.Foreground is not explicitly set, bind it to parentMap.Foreground
// If this.Foreground is not explicitly set, bind it to parentMap.Foreground.
//
this.SetBindingOnUnsetProperty(ForegroundProperty, parentMap, MapBase.ForegroundProperty, nameof(Foreground));
// If this.BorderBrush is not explicitly set, bind it to parentMap.Foreground
// If this.BorderBrush is not explicitly set, bind it to parentMap.Foreground.
//
this.SetBindingOnUnsetProperty(BorderBrushProperty, parentMap, MapBase.ForegroundProperty, nameof(Foreground));
}
}

View file

@ -66,10 +66,12 @@ namespace MapControl
{
if (map != null)
{
// If this.Forground is not explicitly set, bind it to map.Foreground
// If this.Forground is not explicitly set, bind it to map.Foreground.
//
this.SetBindingOnUnsetProperty(ForegroundProperty, map, MapBase.ForegroundProperty, nameof(Foreground));
// If this.Stroke is not explicitly set, bind it to this.Foreground
// If this.Stroke is not explicitly set, bind it to this.Foreground.
//
this.SetBindingOnUnsetProperty(StrokeProperty, this, ForegroundProperty, nameof(Foreground));
}