Class ViewFileValidator
Checks a .view.xml against the schema without building anything from it.
public static class ViewFileValidator
- Inheritance
-
ViewFileValidator
- Inherited Members
Remarks
A view that breaks the schema is only found when somebody opens that screen: the load throws a ValidationException out of CreateView(IViewBuilder), which surfaces as an unhandled exception mid-frame. An attribute on the wrong control is enough to do it -- and since the schema is derived from the model types at load time, it is rejected outright rather than ignored.
Everything needed to find that at build time was already here; none of it was reachable from outside this assembly, because the builders are internal. This is the public door: a consumer can walk its shipped views in a test and be told which ones would fail, rather than finding out one screen at a time.
Schema only -- it does not resolve <References>, load textures or fonts, or
check that a binding names a property the view model has. It answers "will this file
parse", which is the failure that has no other early warning.
Methods
Validate(IFileSystem, string)
The schema errors in path, read through the given file system.
public static IReadOnlyList<string> Validate(IFileSystem fileSystem, string path)
Parameters
fileSystemIFileSystempathstring
Returns
Validate(string)
The schema errors in path, or an empty list if it is valid.
public static IReadOnlyList<string> Validate(string path)
Parameters
pathstring