Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi@all,

it's possible to give Parameter to an ObjectDataProvider (ODP).

E.g.:
XML
<TextBox.Text><Binding Source="{StaticResource MyODP}"
                                                 Path="MethodParameters[0]"
                                                 BindsDirectlyToSource="true"
                                                 UpdateSourceTrigger="PropertyChanged" />
                                            </TextBox.Text>


In my app I have two ObjectDataProvider.
I'm using the first one to build a Treeview (using HierarchicalDataTemplate/DataTemplate) It's possible to filter the Treeview (first ODP), using the solution I have posted above.
(It must not be a TextBox. Its also possible with a CheckBox, etc.)

Now I want to filter the second ODP. As Parameter for the second ODP I want to use Treeview's SelectedItem (a property of the object behind)
I have no Idea how to to realize that :((

Treeview's Datatemplate:
XML
<DataTemplate x:Key="myItemTemplate" DataType="{x:Type MyDataObject}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}"/>
.....


Thank you in advance!
Posted
Updated 8-Apr-10 4:20am
v2

Hello,

Why don't bind you use the same thing on the SelectedItem of your TreeView ?
 
Share this answer
 
Hello jmix,

thank you for your reply.

What exactly do you mean?
Using only one ODP?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900