ListView ItemClick with MVVM
<p>I'm new with MVVM and there is something I don't understand. The code I have so far :</p>

<p>In ItemListPage.xaml :</p>

<pre><code>&lt;ListView ItemsSource="{Binding itemList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
          SelectedItem="{Binding itemSelected, Mode=TwoWay}"
          ItemClick="{x:Bind ViewModel.ClickItemList}"&gt;
</code></pre>

<p>In ItemListViewModel.cs :</p>

<pre><code>    private List&lt;Item&gt; _itemList;
    public List&lt;Item&gt; itemList { get { return _itemList; } set { Set(ref _itemList, value); } }
    private Item _itemSelected;
    public Item itemSelected { get { return _itemSelected; } set { Set(ref _itemSelected, value); } }

    public void ClickItemList()
    {
        System.Diagnostics.Debug.WriteLine("Click on itemlist");
        if (itemSelected != null)
        {
            ((App)App.Current)._itemID = itemSelected._ID;
            NavigationService.Navigate(typeof(Views.ShowItem));
        }
    }
</code></pre>

<p>The problem I have is on my first click on an item, the function ClickItemList is called but the attribute itemSelected is still empty, so I need to click a 2nd time on an item to actually do the action I want to do (save this item's ID and navigate to the next page). How can I change my code to do that ?</p>

<p>Aside from this problem, I don't understand why I should use 2 attributes (for example the private attribute _itemSelected and the public "fake" attribute itemSelected), why can't I use only one ?</p>