I have not touched C# in years and low and behold it has drastically changed.
I am working on a small project and I am looking for help for the following scenario:
the following listbox is bound to an XML file that is included into the project at design time in XAML.
Quote:
|
<ListBox x:Name="LbAud" ItemsSource="{Binding Source={StaticResource XmlData}, XPath=Terms/Audience}" HorizontalAlignment="Left" Margin="99,142,0,0" VerticalAlignment="Top" Width="350" Height="68"/>
|
What I would like to do is to rebind the came control to a different XML file based on a user's choice.
All told I have 3 independent XML files, that contain similar information and I would like to reuse the same existing listboxes and procedures for any of those files. just switch the binding of the various listboxes to different XML files.
For your information, there will be 5 listboxes that depending on the user's choice load from different xml files
I was thinking initially of creating 15 listboxes and hiding/showing them depending on the user's choice, but that seems to be a waste of resources.
So instead i want to re-utilize the same boxes and populate from different lists.
All is coded in C# XAML (which is new to me) and should run in a WPF environment.
I appreciate your help