mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
WinUI value converters
This commit is contained in:
parent
e006cbedc6
commit
933cb7f2ba
6 changed files with 83 additions and 32 deletions
|
|
@ -48,20 +48,22 @@ namespace MapControl
|
|||
Add(new Location(latitude, longitude));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Join(" ", this.Select(l => l.ToString()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a LocationCollection instance from a string containing a sequence
|
||||
/// of Location strings that are separated by a spaces or semicolons.
|
||||
/// </summary>
|
||||
public static LocationCollection Parse(string locations)
|
||||
{
|
||||
if (string.IsNullOrEmpty(locations))
|
||||
{
|
||||
return new LocationCollection();
|
||||
}
|
||||
|
||||
var strings = locations.Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
return new LocationCollection(strings.Select(l => Location.Parse(l)));
|
||||
return string.IsNullOrEmpty(locations)
|
||||
? new LocationCollection()
|
||||
: new LocationCollection(locations
|
||||
.Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(Location.Parse));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue