Change ContactSearchResultList Binding at runtime RRS feed

  • Question

  • Im working with the Lync 2010 SDK and using a ContactSearchResultList bound to a ContactSearchInputBox. The Binding is done in the xaml-Definition like this:

    <controls:ContactSearchResultList Name="contactSearchResultList1" ItemsSource="{Binding Results, ElementName=contactSearchInputBox1, Mode=OneWay}" />

    Now I want to change the Binding to another ContactSearchInputBox at runtime. I tried it like this:
    System.Windows.Data.Binding searchBinding = new System.Windows.Data.Binding();
    searchBinding.Source = contactSearchInputBox2.Results;
    contactSearchResultList1.SetBinding(ItemsControl.ItemsSourceProperty, searchBinding);

    It does not throw any error, but the result list stays empty no matter what I do after I change the binding at runtime... Any ideas?

    • Edited by Moritz O Monday, February 4, 2013 11:18 AM
    Monday, February 4, 2013 11:17 AM