You can use 2 good approaches:
- You can return a value tuple:
public (double lati, double longi) Convert(
object value, Type targetType, object parameter, CultureInfo culture)
{
var mapClickedEventArgs = value as Xamarin.Forms.Maps.MapClickedEventArgs;
var currentPossition = mapClickedEventArgs;
var lati = currentPossition.Position.Latitude;
var longi = currentPossition.Position.Longitude;
return (lati, longi);
}
Note, I wasn't sure what is the data type of lati
& longi
so I assumed it is of type double
. In case it is a different type, please change the return values from double
to the relevant type.
- Return the
Position
class or create your own class that will include the properties lati
& longi
and instead of returning an object
, return this class. The last row will be something like:
return currentPosition.Position;
Or:
return new YourClassName(lati, longi);
UPDATE:
Maybe, I didn't understand the question right. Maybe you can't change the method signature.
If this is the case, you can just return it using anonymous types:
return new { lati, longi };