public static Uri ResolvePartUri(Uri sourcePartUri, Uri targetUri)
{
Check.SourcePartUri(sourcePartUri);
Check.TargetUri(targetUri);
Check.PartUriIsValid(sourcePartUri);
// commented out because on Android they are absolute file:///
// if (targetUri.IsAbsoluteUri)
// throw new ArgumentException("targetUri", "Absolute URIs are not supported");
Uri uri = new Uri("http://fake.com");
uri = new Uri(uri, sourcePartUri);
uri = new Uri(uri, targetUri);
// Trim out 'http://fake.com'
return new Uri(uri.OriginalString.Substring(15), UriKind.Relative);
}