title: Attach behavior in code behind
body: <p>I have the following Xaml that is used in a user control that used as an editor inside a property grid. The question is, what would the c# look like to attach a behavior from the code behind?</p>
  
  <pre><code>&lt;i:Interaction.Behaviors&gt;
      &lt;igExt:XamComboEditorSelectedItemsBehavior SelectedItems="{Binding SelectedItems, ElementName=_uc}"/&gt;
  &lt;/i:Interaction.Behaviors&gt;
  </code></pre>
  
  <p>Since this is on an editor that is loaded dynamically in a PropertyGrid, I was just going to create an instance of the editor with binding from code behind rather than having to have different xaml files that are really short and just contain one editor.</p>
  
  <p>Or would it be easier to simply re implement all of the code that is in the Behavior and call it while I'm creating the editor in the code behind?</p>