Hi i'm new to WPF entirely, I would like to be able to control the margin value of anything that is in the XAML via a variable in the CS file , i've read up a few questions/answers on stackoverflow, tried to implement it as such but it dosen't seem to work . 

This is what i've tried so far, but i couldn't get it to work somehow, really need advise on this.

```
public partial class MainWindow : Window, INotifyPropertyChanged
{
   private Thickness _Margin = new Thickness(100, 20, 0, 0);

   public Thickness Margin
   {
       get { return _Margin; }
       set
       {
           _Margin = value;
           //Notify the binding that the value has changed.
           this.OnPropertyChanged("Margin");
       }
   }
    public MainWindow()
    {
        InitializeComponent();

        No.DataContext = _Margin;
    }

    protected void OnPropertyChanged(string strPropertyName)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(strPropertyName));
    }

    public event PropertyChangedEventHandler PropertyChanged;
}

```

XAML:

```
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
<Grid Name="No">
    <Border BorderBrush="Silver" BorderThickness="1" Height="100" HorizontalAlignment="Left" Margin="{Binding _Margin}" Name="border1" VerticalAlignment="Top" Width="200" />
</Grid>
</Window>

```