I have a few xaml files that I use throughout my application. I wish to write unit tests to test the performance of each xaml file, in other words, how long would it take to load/parse and render one of the windows (which use certain xaml files).
I have found XamlReader class which (I think) does exactly this. However, I know that Application.LoadComponent()
(in System.Windows) also can be used for similar things. If you had to test how long does it take for an entire xaml document to parse, what would you use?
XamlReader.Load()
/ XamlReader.Parse()
or Application.LoadComponent()
, or something entirely different?
What would be the best course of action in this scenario?
Also, since I have little experience when it comes to performance testing programmatically, what is a good way of measuring load time, would a stopwatch class from System.Diagnostics be appropriate?