title: Commanding with Static Items of Listbox using MVVM
body: <p>I have a list box in my view with three static items(Name,Age,Gender), and I want my ViewModel to do something when an item in the ListBox is selected. I want to do this without any code-behind, using the MVVM pattern.</p>
  
  <p>My goal is to navigate to a page when an item is selected also the items stated above does not come from an observable list, it is hardcoded in my XAML. How would I do that? Please teach me. If you don't mind to send a sample, that would be a great help. Thanks much in advance.</p>
  
  <pre><code>&lt;ListBox x:Name="lbviewlist"&gt;
      &lt;i:Interaction.Triggers&gt;
          &lt;i:EventTrigger EventName="SelectionChanged" &gt;
              &lt;Command:EventToCommand Command ="{Binding ViewCommand}"
                  PassEventArgsToCommand="True"/&gt;
          &lt;/i:EventTrigger&gt;
      &lt;/i:Interaction.Triggers&gt;
      &lt;ListBox.Items&gt;
          &lt;StackPanel  x:Name="lbiview1" Orientation="Vertical"&gt;
              &lt;ListBoxItem Content="Name" FontSize="35" Margin="10,0,0,0"
                  Foreground="OrangeRed"/&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="View name of the patient"  
                  FontSize="25"  Margin="10,0,0,0" Foreground="White"/&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel x:Name="lbiview2" Orientation="Vertical"&gt;
              &lt;ListBoxItem Content="Age"  FontSize="35" Margin="10,20,0,0"
                  Foreground="OrangeRed"/&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="View age of the patient"  
                  FontSize="25"  Margin="10,0,0,0" Foreground="White"/&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel x:Name="lbiview3"  Orientation="Vertical"&gt;
              &lt;ListBoxItem Content="Gender" FontSize="35" Margin="10,20,0,0"
                  Foreground="OrangeRed"/&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="View the gender of the patient"
                  FontSize="25" Margin="10,0,0,0" Foreground="White"/&gt;
          &lt;/StackPanel&gt;
      &lt;/ListBox.Items&gt;                    
  &lt;/ListBox&gt;
  </code></pre>