locked
How can I expose a property of a constituent control? RRS feed

  • Question

  • Using Expression Blend 2, I want to create a control that consists of several controls and expose some of the properties of the constituent controls to the containing control. I'm sure this is a common thing but I'm a bit too newbie to find a walk-through/tutorial/example for my level.

    For example, I create a new wpf project choosing C# as my language, add a grid control then add a rectangle and a label to the grid. I right-click on my grid & choose Make Control and choose the default name UserControl1. I build the solution & change back to my main window where I can now add instances of my lovely new control. I'd like to change the label property inside each of my controls but I don't know how to expose it. I do know that UserContol1.xaml.cs now appears in my project files & I know there's going to be some getting & setting going on.

    Thanks,

    Paul.

     

    Edit:

    I found this excellent walkthrough.

    http://www.kirupa.com/blend_wpf/usercontrols_dependency_properties_pg1.htm


    • Edited by MSL-KVJK-HWV8 Friday, June 24, 2011 11:20 AM Resolved
    Friday, June 24, 2011 9:53 AM