title: Close UWP flyout with listview item click
body: <p>I'm trying to close a flyout on a listview item click. The problem is that during runtime, the CallMethodAction can't find the hide method of the flyout menu. How can I fix this?</p>
  
  <pre><code>    &lt;Flyout x:Name="UnitFlyout"&gt;
          &lt;ListView x:Name="ArmyUnitListView" ItemsSource="{Binding Source={StaticResource ArmyUnitCollection}}" SelectionMode="Single"  &gt;
               &lt;ListView.GroupStyle&gt;
                      &lt;GroupStyle HidesIfEmpty="True" HeaderTemplate="{StaticResource ArmyListDataGroupTemplate}" /&gt;
                &lt;/ListView.GroupStyle&gt;
              &lt;ListView.ItemContainerStyle&gt;
                   &lt;Style TargetType="ListViewItem"&gt;
                        &lt;Setter Property="HorizontalContentAlignment" Value="Stretch" /&gt;
                   &lt;/Style&gt;
                 &lt;/ListView.ItemContainerStyle&gt;
                 &lt;interactivity:Interaction.Behaviors&gt;
                       &lt;core:EventTriggerBehavior EventName="SelectionChanged"&gt;
                             &lt;core:InvokeCommandAction Command="{Binding AddUnitCommand}" CommandParameter="{Binding SelectedItem, ElementName=ArmyUnitListView}" /&gt;
                              &lt;core:CallMethodAction TargetObject="UnitFlyout" MethodName="Hide"/&gt;
                        &lt;/core:EventTriggerBehavior&gt;
                  &lt;/interactivity:Interaction.Behaviors&gt;
           &lt;/ListView&gt;
      &lt;/Flyout&gt;
  </code></pre>