-
Nov 4th, 2010, 10:11 AM
#1
Databinding expression - refer to parent?
I had a control in my main app, and now I want to house it inside a user control. Inside of the main app, I had a listbox that had an ItemsSource property items that were bound to a control with code like the following:
Code:
<ListBox x:Name="lstLayers" ItemsSource="{Binding ElementName=MyMap, Path=Layers.[MyMapService].Layers}" ...
Now that it is in the user control, the "MyMap" element is in the main app and not the user control, so the binding doesn't work. How do I modify this expression to have it refer to the same element, but in the main parent app? Can I do it in XAML, or do I do this behind the scenes? If behind the scenes, what code?
*** To clarify, I want to know if there is a way to do this based on a parent/child relationship. I can get the control to work through other means.
Last edited by gigemboy; Nov 4th, 2010 at 10:39 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|