Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an array of booleans loaded from a XML file. On the UI I have the same amount of radio buttons.

What would be the most efficient way to bind them?

Regards,

Igal
Posted

1 solution

Build a class and use DataContracts..

<xmlContractClass>
      <val1>true</val1>
      <val2>true</val2>
      <val3>true</val3>
</xmlContractClass>

then in code:
using System.Runtime.Serialization;
namespace yours{
[DataContract]
class xmlContractClass{
     [DataMember(Order = 0)]
     bool val1,val2,val3;



}}



there are plenty of other examples online @ msdn... :-D
 
Share this answer
 
Comments
Igal_Kroyter 20-Jul-10 23:30pm    
Thanks, for the reply.

I actually was refering to the actual binding betwwen the XAML and a class.
The class was obtained by utilizing the XSD service/application which provided me a class from a XML schema. One of the memebers of the class is an array.
I know that I can bound a Listbox to this array through ObservableCollection. But I have aranged the Radio buttons on a WrapPanel.
So I was wondering how I could efficiently(or not efficiently) bind each radio button to a specific item in the array directly. (I was thinking creating a dependency property for each item in the array....)

Igal

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900