The dependency property does not work.
UserControl.cs:
// private double Radius = 100; private void DrawScale() { double bigTick = 9; for (double i = 0; i <= 90; i = i + bigTick) { Point p = new Point(0.5, 0.5); Rectangle r = new Rectangle { Height = 5, Width = 15, Fill = new SolidColorBrush(Colors.Aqua), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, RenderTransformOrigin = p }; TransformGroup trGp = new TransformGroup(); RotateTransform rTr = new RotateTransform(); double iRadian = (i * Math.PI) / 180; rTr.Angle = i; trGp.Children.Add(rTr); TranslateTransform tTr = new TranslateTransform(); tTr.X = (int) ((Radius) * Math.Cos(iRadian)); tTr.Y = (int) ((Radius) * Math.Sin(iRadian)); trGp.Children.Add(tTr); r.RenderTransform = trGp; gr.Children.Add(r); } } public double Radius { get { return (double)GetValue(MyPropertyProperty); } set { SetValue(MyPropertyProperty, value); } } public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.Register("Radius", typeof(double), typeof(RoundScale), null); userControl.xaml
<Grid x:Name="gr"/> MainWindow.xaml
<Grid> <local:RoundScale Radius="90" /> </Grid> If the Radius variable in UserControl.cs is uncommented and the dependency property is removed from the code, then everything works as it should.