title: Bind command to Loaded event of view
body: <p>I am trying to get a method to run when a view has finished loading. I have tried to bind a command to the <code>Loaded</code> event in the view but it fails to run. The inner exception that is thrown is </p>
  
  <blockquote>
    <p>'Provide value on 'System.Windows.Data.Binding' threw an exception.' 
    Line number '14' and line position '14'</p>
  </blockquote>
  
  <pre><code>&lt;UserControl x:Class="Components.Map.MapView"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:map="clr-namespace:Components.Map"
               xmlns:controls="clr-namespace:Windows.Controls;assembly=Windows.Controls"
               xmlns:ValidationRules="clr-namespace:Windows.Controls.ValidationRules;assembly=Windows.Controls"
               xmlns:directGraphicsControl="clr-namespace:Windows.DirectGraphicsControl;assembly=Windows.DirectGraphicsControl"
               xmlns:colorBar="clr-namespace:Components.Common.ColorBar;assembly=Components.Common"
               xmlns:RefinedRibbonControls="clr-namespace:Components.Common.Controls.RefinedRibbonControls;assembly=Components.Common"
               xmlns:UserControls="clr-namespace:Components.Common.UserControls;assembly=Components.Common"
               xmlns:map1="clr-namespace:Models.Map;assembly=Models.Map"
               xmlns:utilities="clr-namespace:Windows.Utilities;assembly=Windows.Utilities"
               xmlns:system="clr-namespace:System;assembly=mscorlib"
               Loaded="{Binding Path=MapControlViewModel.MapLoadedCommand}"&gt;
  </code></pre>
  
  <p>How am I able to bind to a view&rsquo;s <code>Loaded</code> event so I can run something after the view has finished loading?</p>