public Uri ResolveTemplate(string relativeUri) { string path = Path.Combine(Store.ViewSourceLoader.ViewRootDir, ReferencingTemplateName); Uri resolvedUri = new Uri(new Uri(path), relativeUri); //The referencing template becomes a template of the resolved template Uri basePath = new Uri(Store.ViewSourceLoader.ViewRootDir + Path.DirectorySeparatorChar); Uri relative = basePath.MakeRelativeUri(resolvedUri); path = relative.OriginalString.ToLowerInvariant().Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); path = path.Replace(Path.GetExtension(path), string.Empty); Store.AddDependency(path, ReferencingTemplateName); return(resolvedUri); }