Type 'Windows.Devices.Geolocation.Geopoint' cannot be serialized
<p>I am working on an UWP application with Prism 6 and when I close it in debug mode, an error occurs <code>Type 'Windows.Devices.Geolocation.Geopoint' cannot be serialized.</code>
Occurs when OnSuspend.</p>

<p>Before this error occurred with other classes, but have read that classes must have a parameterless constructor for a successful serialization. This helped, but now an error with Geopoint.</p>

<p>Where and how dopavit′ default constructor to the class Geopoint?</p>

<p>Error:</p>

<p><code>"Type 'Windows.Devices.Geolocation.Geopoint' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required."</code></p>

<p>Stack Trace:
<code>System.Runtime.Serialization.DataContract.DataContractCriticalHelper.ThrowInvalidDataContractException(String message, Type type)\r\n   at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.CreateDataContract(Int32 id, RuntimeTypeHandle typeHandle, Type type)\r\n   at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation(Int32 id, RuntimeTypeHandle typeHandle, Type type)\r\n   at System.Runtime.Serialization.XmlObjectSerializerContext.GetDataContract(RuntimeTypeHandle typeHandle, Type type)\r\n   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)\r\n   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)\r\n   at WriteKeyValueOfstringanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )\r\n   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n   at WriteArrayOfKeyValueOfstringanyTypeToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )\r\n   at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)\r\n</code></p>

<p>Update:
The thing that I'm nowhere explicitly do not serialize Geopoint.</p>

<p>I use only</p>

<pre><code>private Geopoint _mapCenter;
private Geopoint _myLocation;

[RestorableState]
public Geopoint MyLocation
{
    get { return _myLocation; }
    set { SetProperty(ref _myLocation, value); }
}

[RestorableState]
public Geopoint MapCenter
{
    get { return _mapCenter; }
    set { SetProperty(ref _mapCenter, value); }
}

Geolocator locator = new Geolocator();

private async void GetMyLocation()  
    {
        try
        {
            var location = await locator.GetGeopositionAsync(TimeSpan.FromMinutes(20), TimeSpan.FromSeconds(30));
            MyLocation = location.Coordinate.Point;
        }
        catch (Exception)
        {
            MyLocation = GlobalConst.DefaultGeoPoint;
            LoadingBlockProgressIndicatorValue += 20;
        }

        MapCenter = MyLocation;
        LoadingBlockProgressIndicatorValue += 20;
    }
</code></pre>