title: BindingExpression path error: property not found
body: <p><strong>BusyIndicator.xaml</strong></p>
  
  <pre><code>&lt;UserControl x:Class="Eigen.Modules.Modelling.Components.BusyIndicator"
               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" 
               xmlns:local="clr-namespace:Eigen.Modules.Modelling.Components"
               xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
               xmlns:gif="http://wpfanimatedgif.codeplex.com"
               mc:Ignorable="d" 
               d:DesignHeight="150" d:DesignWidth="150"
               DataContext="{Binding RelativeSource={RelativeSource Self}}"&gt;
  
      &lt;Grid Width="{Binding Width}" Height="{Binding Height}"&gt;
          &lt;telerikControls:RadBusyIndicator IsIndeterminate="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=IsIndeterminate}"&gt;
              &lt;Border BorderBrush="White" Background="#A9FFFFFF" BorderThickness="1"&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="*"/&gt;
                          &lt;RowDefinition Height="Auto"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
  
                      &lt;Border Padding="5,0" Grid.Row="0"&gt;
                          &lt;Image gif:ImageBehavior.AnimatedSource="/`enter code here`Resources/matriksenerji.gif" gif:ImageBehavior.AutoStart="True"/&gt;
                      &lt;/Border&gt;
  
                      &lt;Border Padding="5" Grid.Row="1"&gt;
                          &lt;TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Label}" FontWeight="SemiBold" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center"/&gt;
                      &lt;/Border&gt;
                  &lt;/Grid&gt;
              &lt;/Border&gt;
          &lt;/telerikControls:RadBusyIndicator&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p><strong>BusyIndicator.xaml.cs</strong></p>
  
  <pre><code>public partial class BusyIndicator : UserControl
  {
      public BusyIndicator()
      {
          InitializeComponent();
      }
  
  
  
      public string Label
      {
          get { return (string)GetValue(LabelProperty); }
          set { SetValue(LabelProperty, value); }
      }
  
      // Using a DependencyProperty as the backing store for Label.  This enables animation, styling, binding, etc...
      public static readonly DependencyProperty LabelProperty =
          DependencyProperty.Register("Label", typeof(string), typeof(MatriksBusyIndicator), new PropertyMetadata(string.Empty));
  
  
  
      public bool IsIndeterminate
      {
          get { return (bool)GetValue(IsIndeterminateProperty); }
          set { SetValue(IsIndeterminateProperty, value); }
      }
  
      // Using a DependencyProperty as the backing store for IsProgress.  This enables animation, styling, binding, etc...
      public static readonly DependencyProperty IsIndeterminateProperty =
          DependencyProperty.Register("IsIndeterminate", typeof(bool), typeof(MatriksBusyIndicator), new PropertyMetadata(true));
  
  }
  </code></pre>
  
  <p><strong>Using in Page.xaml</strong></p>
  
  <p>...</p>
  
  <pre><code>&lt;!--BusyIndicator--&gt;
  &lt;components:BusyIndicator IsIndeterminate="True" 
                            Visibility="{Binding IsProgress, Converter={StaticResource BoolToVisConverter}}" 
                            Label="{lex:Loc CalculatingProgress}"
                            Grid.Column="1" 
                            VerticalAlignment="Center" 
                            HorizontalAlignment="Center" 
                            Width="150" Height="150"/&gt;
  </code></pre>
  
  <p>...</p>
  
  <p>Error message;</p>
  
  <blockquote>
    <p><em>System.Windows.Data Error: 40 : BindingExpression path error: 'IsProgress' property not found on 'object' ''BusyIndicator'
    (Name='')'. BindingExpression:Path=DataContext.IsProgress;
    DataItem='BusyIndicator' (Name=''); target element is 'BusyIndicator'
    (Name=''); target property is 'Visibility' (type 'Visibility')</em></p>
  </blockquote>
  
  <p>ViewModel class has "IsProgress" property but can't bind to usercontrol.</p>