title: Setting a UserControl property in XAML
body: <p>I have custom property in my Code Behind that I want to set in the XAML.</p>
  
  <p>Property:</p>
  
  <pre><code>Public Property WindowName() As String Implements IVendorEntryEditView.WindowName
      Get
          Return CType(GetValue(WindowNameProperty), Integer)
      End Get
      Set(ByVal value As String)
          SetValue(WindowNameProperty, value)
      End Set
  End Property
  
  Public Shared ReadOnly WindowNameProperty As DependencyProperty = _
      DependencyProperty.Register("WindowName", GetType(String), GetType(VendorEntryEditView), _
          New PropertyMetadata(""))
  </code></pre>
  
  <p>However, I'm getting an <code>Attached property has no setter</code> message in my XAML when I try to set it:</p>
  
  <pre><code>&lt;UserControl x:Class="VendorEntryEditView"
           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:EntryEditUi"
           mc:Ignorable="d"
           Loaded="VendorEntryEditView_OnLoaded"
           local:VendorEntryEditView.WindowName="test"
           d:DesignHeight="300" d:DesignWidth="300"&gt;
  </code></pre>
  
  <p>How can I set that property in XAML? Thanks!</p>