Dependencyproperty strange behavior
<p>I've created my usercontrol with a dependencyproperty.
I noted that if the dependency property has the same name regitered of property, when I insert the control inside in a windows and write via xaml code the value , this control not show the labels, I need insert in codebehind the value and when start the application the control show the labels.</p>

<p>If I change the registered name of dependancypropety the controll Show the labels without pass the value via code behind, and show the lable each time I modify the value via xaml or via codebehind.</p>

<p>this is my usercontrol.
xaml:</p>

<pre><code>&lt;UserControl x:Class="My.Controls.MyUserControl1"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300"&gt;
&lt;Grid x:Name="GridRoot"&gt;

&lt;/Grid&gt;
</code></pre>

<p></p>

<p>and this is code behind:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace My.Controls
{
   /// &lt;summary&gt;
/// Interaction logic for Plate.xaml
/// &lt;/summary&gt;
public partial class MyUserControl1 : UserControl, INotifyPropertyChanged
{
    private Point pointOfOrigin;
    private Double labelsRad;
    //private Byte numOfChucks;
    private List&lt;Label&gt; labelNumber = new List&lt;Label&gt;();
    private List&lt;Canvas&gt; label = new List&lt;Canvas&gt;();

    #region - Dependency Properties mandatory for Binding -
    public static readonly DependencyProperty NumOfLabelsProperty =
        DependencyProperty.Register("NumOfLabels", typeof(byte), typeof(MyUserControl1), new PropertyMetadata(byte.MinValue));
    #endregion - Dependency Properties for Binding -

   [DefaultValue(byte.MinValue)]
    public byte NumOfLabels
    {
        get { return (byte)GetValue(MyUserControl1.NumOfLabelsProperty); }
        set
        {
            if (this.NumOfLabels != value)
            {
                SetValue(MyUserControl1.NumOfLabelsProperty, value);
                LabelsRender();
                OnPropertyChanged("NumOfLabels");
            }
        }
    }

    public MyUserControl1()
    {
        InitializeComponent();
        this.DataContext = this;

        //just to show when the control is designer mode
        pointOfOrigin = new Point(this.ActualWidth / 2, this.ActualHeight / 2);
        labelsRad = this.Width / 2;
    }

    private void PosLabels()
    {
        var indexLabel = Byte.MinValue;
        var pointLabel = new Point();

        for (; indexLabel &lt; this.NumOfLabels; indexLabel++)
        {
            pointLabel = new Point((this.ActualWidth + (indexLabel * 50) )/2,(this.ActualHeight + (indexLabel *50))/2) ;
            Canvas.SetLeft(labelNumber[indexLabel], pointLabel.X);
            Canvas.SetTop(labelNumber[indexLabel], pointLabel.Y);
        }
    }
    private void RemoveLabels()
    {
        var indexLabel = Byte.MinValue;

        for (; indexLabel &lt; labelNumber.Count; indexLabel++)
        {
            this.label[indexLabel].Children.Remove(labelNumber[indexLabel]);

            this.GridRoot.Children.Remove(label[indexLabel]);
        }

        //clean up 
        labelNumber.Clear();
        labelNumber.Clear();
        GC.Collect();
    }
    private void AddLabels()
    {
        var indexLabel = Byte.MinValue;

        for (; indexLabel &lt; this.NumOfLabels; indexLabel++)
        {
            labelNumber.Add(
               new Label()
               {
                   Content = (indexLabel + 1).ToString("D2"),
                   Height = 23,
                   Width = 23,
                   Name = "labelNumber" + indexLabel,

               });
            label.Add(
                new Canvas()
                {
                    Name = "Label" + indexLabel,
                    Height = 23,
                    Width = 23,
                });

            label[indexLabel].Children.Add(labelNumber[indexLabel]);
            this.GridRoot.Children.Add(label[indexLabel]);

        }
    }

    private void LabelsRender()
    {
        RemoveLabels();
        AddLabels();
        PosLabels();
    }
    #region - INotifyPropertyChanged implementation -
    // Basically, the UI thread subscribes to this event and update the binding if the received Property Name correspond to the Binding Path element
    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual void OnPropertyChanged(string propertyName)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null)
            handler(this, new PropertyChangedEventArgs(propertyName));
    }
    #endregion - INotifyPropertyChanged implementation -
}
</code></pre>

<p>this is the windowtest
xaml:</p>

<pre><code>&lt;UserControl x:Class="My.Controls.MyUserControl1"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300"&gt;
&lt;Grid x:Name="GridRoot"&gt;

&lt;/Grid&gt;
&lt;/UserControl&gt;
</code></pre>

<p>this is codeBehind:</p>

<pre><code>enter cousing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace XTesting
{
/// &lt;summary&gt;
/// Interaction logic for WindowTest.xaml
/// &lt;/summary&gt;
public partial class WindowTest : Window
{
    public WindowTest()
    {
        InitializeComponent();
        this.MyUserControl.NumOfLabels = 7;
    }
}
}
</code></pre>

<p>if you want to try please delete the line after Initialize component and change de property dependency name in this form</p>

<pre><code>public static readonly DependencyProperty NumOfLabelsProperty=DependencyProperty.Register("NumOfLabelsP",typeof(byte),typeof(MyUserControl1), new PropertyMetadata(byte.MinValue));
</code></pre>