I wrapped a standard control as discussed here Quickest way to inherit a standard control in WPF?
in a user control. Now is there a way to automatically expose properties and events of a standard wpf control wrapped in a user control ? Could I use something like automatic Bubbling routing but how exactly ?
Otherwise I’ll have to also create properties and events wrappers for my component that is cumbersome.
Yes, you have to provide new Dependency Properties on the user control to expose properties to the outside. As an example:
TimeframeSelector.xaml
TimeframeSelector.xaml.cs
You need to use the
RelativeSourcebinding as you won’t find the DP in the visual tree otherwise. If you are using Visual Studio, there is template namedpropdpwhich you can use to create depedendency properties very fast.