Hi,
I'm trying to parse one Xaml file, which has merged dictionaries property, which references a couple of other Xaml files.
So the file I want to parse
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/XamlHelper;component/Resources/NestedXaml/Nested1.xaml"></ResourceDictionary> <ResourceDictionary Source="pack://application:,,,/XamlHelper;component/Resources/NestedXaml/Nested2.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries></ResourceDictionary>
What I'm doing right now (don't know if it's correct) is getting this xaml file as a string with:
var xamlToParse = System.IO.File.ReadAllText("myDir/Main.xaml");
and then:
var result = XamlReader.Parse(xamlToParse);
If I do this this way, will the parser go into my 2 merged XAML files, and parse them as well?
What would be a better way of doing this, since I want to measure the time it took for the all XAML files to parse.
Thanks.