Link to home
Create AccountLog in
Avatar of neutral_penguin
neutral_penguin

asked on

Using XML files to define WPF button properties

I am currently writting a Touchscreen interface for a client and they want the ability to configure a terminal at one site and easily transfer the setting to another site/terminal. The why I have decided to acheive this was to save the settings to an xml file and then load the settings from the file when the form loads.

I can interface with the xml file easily enough but don't know how to go from there to using the elements in the xml file to define the properties of the buttons on the screen.

for the record the code i am using to interface with the xml file is as follows:

CDocument xml = XDocument.Load(@"Settings.xml");

var query = from b in xml.Elements("Buttons").Elements("Button")
                    select b;

My guess is that I don't define the query output as a var but i don't know what else to define it as. Any help in this would be most helpful.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
>>  most Linq queries return IEnumerable objects.

I should probably say, "many Linq queries return IEnumerable objects."
Avatar of neutral_penguin
neutral_penguin

ASKER

this is exactly what I was after. cheers!
NP. Glad to help  :)