CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [WPF] Binding

  1. #1
    Join Date
    May 2009

    [WPF] Binding


    I have WPF aplication with two ListView a firt affects second using SelectionChanged="ListView_SelectionChanged" and I need in C# change ItemsSource for second ListView in ListView_SelectionChanged method.

    Data is in <Window.Resources> and is it XmlDataProvider.

    Can you help me please ?

  2. #2
    Join Date
    Jan 2009

    Re: [WPF] Binding

    Is the data provider hooked up to anything in XAML at all or is it just used in your code? If it is just used in your code, the data may not be loaded as you would expect. Try setting IsAsynchronous to False on your XmlDataProvider.

    The actual assignment to the ItemsSource would probably look something like:

    this.yourListView.ItemsSource = ((XmlDataProvider)this.Resources["yourXmlDataProviderKey"]).Data as IEnumerable;
    Last edited by gurge60; May 27th, 2009 at 01:55 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.