WPF + MVVM - Access object/property in UserControl -
I have found a way to use the object / property within a UserControl I have a page object, in which I load a user Icontrol:
& lt; UserControl: RichTextEditorControl Height = "350" />
How can I use my object / property which is in my view mendall with the control of my user? To put my problem in practice: I have a list of items that have been displayed in my view, and when I have selected an item, then I load the usercontrol I want my user to How to do "stuff" in selected items?
Thanax!
You may have a dependency property on your UserControl, or only this datacontent would be the selected item. . After this you can simply set up user control using binding:
& lt; UserControl1 DataContext = "{Binding Selection Object Properties}" />
If your list box adds the same TheSelectedObjectProperty
, then when you change the item in the list box automatically, UserControl will see the selected items.
Comments
Post a Comment