Q:

Binding dependency property using XAML

Inside my user control MainControl I have dependency property named Repository. I want to bind this repository property in MainWindow using xaml
<my:MainControl x:Name="mainControl" Repository="{Binding }" Visibility="Visible" />

and inside MainWindow.xaml.cs I have
public MainWindow()
{
    InitializeComponent();
    _repository = new CarRepository();
    DataContext = _repository;
}

Inside MainControl constructor I was thinking to display some text using 
public MainControl()
{
    InitializeComponent();
    lblCountCars.Content = string.Format("there is {0} cars.", Repository.CountAllCars());
}

Am I doing something wrong here Repository="{Binding }"? When I register user control inside code behind everything is ok but I want to learn how to do this using xaml.
Update
To make it clear. I have MainWindow which uses two user controls. MainControl and TreassureControl.
I want to send repository which is of type ICarRepository to any of this controls, so I created DependencyProperty named Repository of type ICarRepository both in MainControl and TreassureControl.
My goal is to send repository instance to MainControl Repository property (DP) and to print on label Content property lblCountCars.Content = Repository.CountAllCars(); 
Also I want this repository instance in user control to further work, not only to show simple text.
So I tried with suggestions bellow
MainWindow.xaml
 <my:MainControl x:Name="mainControl" Repository="{Binding Repository}" />

MainWindow.xaml.cs
private ICarRepository _repository;   
public MainWindow()
{
   InitializeComponent();
   _repository = new CarRepository(); 
   DataContext = _repository;
}

MainControl.xaml
<UserControl x:Name="mainControl">
<Label Name="lblCountBooks" Content="{Binding ElementName=mainControl, Path=Repository.CountAllBooks()}" 
<ItemsControl ItemsSource="{Binding ElementName=mainControl, Path=Repository}" />

MainControl.xaml.cs
public static readonly DependencyProperty RepositoryProperty = DependencyProperty.Register(
            "Repository",
            typeof(ICarRepository),
            typeof(MainControl),
            new PropertyMetadata(null));

        public ICarRepository Repository
        {
            get { return (ICarRepository)GetValue(RepositoryProperty); }
            set { SetValue(RepositoryProperty, value); }
        }

label content is not updated with expected content.

A:

when ever working with dependency properties in usercontrols i use elementname binding for binding to the DP. so i would remove your 

lblCountCars.Content = string.Format("there is {0} cars.",
  Repository.CountAllCars());

and do something like this:
 <UserControl x:Name="uc">
   ...      
   <Label Content="{Binding ElementName=uc, Path=Repository.Count}"/><!-- you can use ContentStringFormat here to get you formattet string-->
   <ItemsControl ItemsSource="{Binding ElementName=uc, Path=Reportsitory}"/>

your binding in your mainwindow looks right.
EDIT:
you can just bind to properties. so instead of Repository.CountAllBooks() you need a property. if you dont have a chance to create a property on your ICarRepository, you can use a converter and the Repository property as convertparameter to get your info.

