In My WPF App i have some pages, and I need to check for example:
new Uri("Pages/Page2.xaml", UriKind.Relative)
exist or not, I tried somethig semilar to this, just from Absolute
replaced to Relative
bool IsRelativeUrl(string url)
{
Uri result;
return Uri.TryCreate(url, UriKind.Relative, out result);
}
Then Is printed:
string url = "Pages/Page2.xaml";
MessageBox.Show(IsRelativeUrl(url).ToString());
And it says always true, even for non existing pages