title: Calling a custom dependency property defined in code-behind from XAML
body: <p>Is it possible to call a custom dependency property in the XAML of the element in which it is defined?</p>
  
  <p>I mean, i have the following simple code for my mainWindow:</p>
  
  <p>Code</p>
  
  <pre><code>public partial class MainWindow : Window
  {
  
      public static readonly DependencyProperty SpecialToProperty =   DependencyProperty.Register("SpecialTo", typeof(double), typeof(MainWindow));
  
      public MainWindow()
      {
  
          InitializeComponent();
  
      }
  
      public double SpecialTo
      {
          get
          {
              return (double)GetValue(SpecialToProperty);
          }
          set
          {
              SetValue(DoubleAnimation.ToProperty, value);
          }
      }
  }
  </code></pre>
  
  <p>How can i use that dependency property from the XAML partial code of the MainWindow class?</p>
  
  <p>I mean something like:</p>
  
  <pre><code>&lt;Window x:Class="WpfAnimationTEst.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"        
      SpecialTo=200&gt;
  </code></pre>
  
  <p>I know it can be done using attached dependency properties, but is it the only way? Is it not possible to call a dependency property defined in the code-behind?</p>
  
  <p>Thank you and sorry if the question is some kind of stupid, i'm just learning and trying to understand WPF.</p>