wpf - data binding on properties confusion -


I have a WPF tabstime whose data reference is set to my object 'Product' 'Get my data from the object I have a list view, whose item source property is set in a list in my object' Product.DetailsList 'list view column' Product. Distinct list is bound to object.

Up until everything works fine, now I need to bind some columns in my list view to the properties of my datacentext object ie ' Product 'Can anyone tell me how can I get it?

I think it is not entirely clear how the hierarchy is in the middle of your control, datacontext Works like this: Access to their children from top level control is being achieved. In this case, if the WPF TabItem is the parental control of ListView, then ListView will have the same DataContext as TabItem.

Besides, by thinking that I can get it right, you can do this:

   

Where the interesting part is the relative source set on FindAncestor and since you know that DataContext is set on the product object, you can ask for the property you want.

HH


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -