public static Uri MakeRelativePath(string fromPath, string toPath)
{
if (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath");
if (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath");
Uri fromUri = new Uri(Path.GetFullPath(fromPath));
Uri toUri = new Uri(Path.GetFullPath(toPath));
if (fromUri.Scheme != toUri.Scheme) { return toUri; } // path can't be made relative.
return fromUri.MakeRelativeUri(toUri);
}