Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Windows Presentation Foundation
Windows Presentation Foundation Discussion of the beta version of Windows Presentation Foundation "WPF" formerly know as codename "Avalon" as well as the related XAML.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Windows Presentation Foundation section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 3rd, 2017, 10:15 AM
Registered User
Join Date: Apr 2017
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Binding a listbox conditionally to different XML data files

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.

<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"/>
how would I go about to load data from a different XML file into the same box?

For your information, there will be 5 listboxes that depending on the user's choice load from different data 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate listbox with xml data: VB2008 QuadFather XML 4 April 12th, 2010 10:43 AM
Problem with binding XMl data into nested repeater vishnu108mishra XML 0 November 19th, 2007 03:53 AM
binding on listbox in datagrid sunil131 VB Databases Basics 0 April 29th, 2007 06:11 AM
Binding XML to a listbox bonekrusher ASP.NET 2.0 Basics 0 March 25th, 2007 08:20 AM
inserting data into xml files courseworkhelp BOOK: ASP.NET Website Programming Problem-Design-Solution 1 January 17th, 2006 11:04 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.