Results 1 to 1 of 1

Thread: Databinding expression - refer to parent?

  1. #1

    Thread Starter
    "The" RedHeadedLefty
    Join Date
    Aug 2005
    Location
    College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
    Posts
    4,495

    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
  •  



Click Here to Expand Forum to Full Width