Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Windows Presentation Foundation
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2017, 10:15 AM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 02:54 PM.

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