XamlPadSample Step 1c-Project
Today I started to teach the XamlDocument class how to find the project that a XAML file is associated with. The technique is somewhat crude right now.
[overview of project: XamlPadSample page –today’s source snapshot: 2010-01-22 Source Snapshot]
I look in the XAML file’s directory for a *.*proj file, then I look in the parent directory, etc… The first project file I find is it!
I don’t currently confirm that the project file contains a reference to the XAML file.
This is the first step to being able to find the app.xaml so we can make these things work:
- {StaticResource someResourceInTheAppResources}
- loading assemblies so custom components/etc… work
Coding fun still happening. Little bit each day.
Detailed changes for step 1c
XamlPadHelpers project
•XamlDocument.cs
◦Added ProjectFileName property and logic to find the associated project file. This is a step towards
supporting resources from app.xaml and loading assemblies.
•XamlEngine.cs
◦Cleaned up implementation of swapping a proxy in for a type that is specified in XAML, but that we should avoid creating (like Window/Page/Application).
◦Moved to use xamlReader.Skip() and alreadyRead bool. (don't like where we ended up with Skip()!..shouldn't need alreadyRead #fail).
◦Added comment about why we wrap exceptions and add line info.
•XamlPadConfig.cs
◦Cleaned up my code via feedback from Steve for how a XamlDocumentViewModel gets its parent pointer to the XamlPadConfig. (Thanks Steve!)
•XamlPad.xaml.cs
◦Added creation of Dictionary<XamlType, XamlType> proxyLookup table to this code. This uses the "cleaned up implementation" I mentioned above.
XamlPadSample project
•MainWindow.xaml.cs
◦Misc clean up.
•Backlog.txt
◦Created a file to list some known issues and change log.