title: Why is parameter not being passed with Relay command
body: <p>I have a user control defined in my project which contains a control to which I need a reference in my view model.  To that end I am handling the loaded event of the user control in my xaml like so:</p>
  
  <pre><code>&lt;UserControl
           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:c1="http://schemas.componentone.com/winfx/2006/xaml" 
           xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
           x:Class="SchedulerView" 
           mc:Ignorable="d" 
           d:DesignHeight="300" d:DesignWidth="300"&gt;
  &lt;i:Interaction.Triggers&gt;
      &lt;i:EventTrigger EventName="Unloaded"&gt;
          &lt;i:InvokeCommandAction Command="{Binding Path=SchedulerUnloadedCommand}" /&gt;
      &lt;/i:EventTrigger&gt;
      &lt;i:EventTrigger EventName="Loaded"&gt;
          &lt;i:InvokeCommandAction Command="{Binding Path=SchedulerLoadedCommand}" CommandParameter="{Binding ElementName=scheduler}"/&gt;
      &lt;/i:EventTrigger&gt;
  &lt;/i:Interaction.Triggers&gt;
  </code></pre>
  
  <p>I have used exactly the same sort of CommandParameter binding in other parts of the project and it has worked well, but for some reason the scheduler object to which I require the reference is not getting passed to the command shown below.</p>
  
  <pre><code>Private _schedulerLoadedCommand As ICommand
  
  Public ReadOnly Property SchedulerLoadedCommand As ICommand
      Get
          If _schedulerLoadedCommand Is Nothing Then
              Dim MySchedulerLoaded As New Action(Of Object)(AddressOf SchedulerLoaded)
              _schedulerLoadedCommand = New RelayCommand(MySchedulerLoaded)
          End If
          Return _schedulerLoadedCommand
      End Get
  End Property
  
  Private Sub SchedulerLoaded(ByVal obj As Object)
      mrvm.scheduler = DirectCast(obj,C1Scheduler)
  
  End Sub
  </code></pre>
  
  <p>A breakpoint placed in the SchedulerLoaded sub shows that the value of the parameter obj is Nothing.</p>
  
  <p>Is it possible that there simply is a tangible version of the scheduler control that I can reference at the time of the Loaded event or is the use of elementName incorrect here.</p>
  
  <p>I'd welcome any thoughts that you might have.</p>