Binding to ActualHeight does not work
问题 I tried to create a custom control, having a semitransparent rounded background: <Canvas> <TextBlock x:Name="StopText" Text="Some test text"/> <Rectangle Fill="SkyBlue" Width="{Binding Source=StopText, Path=ActualHeight}" Height="20" RadiusX="5" RadiusY="5" Opacity="0.2"/> </Canvas> The problem is that I can't, probably, bind to the ActualHeight / ActualWidth properties, cause they are not dependency ones. What to do to mantain the rectangle and textbox of same size? 回答1: The correct binding