In a separate project I have a de-serialized xml file with strings that I want to use in my WPF application, these strings are also used within a different project in the same solution, so I can't just move the strings over to the project holding the wpf application.
The program is structured like this:
Project A references B and C
Project B references C
Project C
Is there a way for me to make a resource or resource dictionary based on the objects from the deserialized xml file? or can I reference the strings stored in the xml file directly?
Turns out I managed to do something that works like I intended, but instead of using the deserialized objects, I used the xml file itself.
Here's what I did:
First I changed the XML file's Build Action
from Content
to Resource
by going Right-click the file -> Properties -> Build Action -> Resource
Then I went into the Xaml file, and added the following to Window.Resources
<XmlDataProvider
x:Key="DropDownData"
Source="/Resource;component/Strings.xml"
XPath="/Strings/String" />
In the drop-down menu that I needed the strings I added this:
ItemsSource="{Binding Source={StaticResource DropDownData}}"
And now my strings are beautifully displayed in the WPF gui.
Thanks for your suggestions though; they may come in useful in the future.