Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 6 > C# 6 General Discussion
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 6 General Discussion Discussions about the C# 6 language and tools not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 6 General Discussion 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 6th, 2017, 09:31 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
Cool change binding at runtime

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.

<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
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
Crystal Report for visual studio 2010, How to change header text at runtime using C# samio2008 BOOK: Professional Crystal Reports for VS.NET 0 August 29th, 2011 09:54 AM
Change web config at runtime louisa68 ASP.NET 3.5 Basics 23 February 23rd, 2009 06:57 AM
binding GridView at runtime! veda Visual Studio 2005 3 August 4th, 2008 06:44 AM
Change datasource of crystal report at runtime check123 Pro VB 6 1 March 21st, 2008 05:45 AM
How to change an ASP: Image Url at runtime ergaurav.nex ASP.NET 1.0 and 1.1 Professional 2 September 5th, 2006 03:44 AM

All times are GMT -4. The time now is 12:02 AM.

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