title: Get value from listBox using List
body: <p>I am using a <code>ListBox</code> and the data is a class:</p>
  
  <pre><code>private class Duration
  {
      public int Value { get; set; }
      public string Label { get; set; }
  }
  </code></pre>
  
  <p>I bind the class in this way:</p>
  
  <pre><code>var durations = new List&lt;Duration&gt;() 
    {
      new Duration() { Value = 5, Label = "5 minutes" }, 
      new Duration() { Value = 10, Label = "10 minutes" }, 
      new Duration() { Value = 15, Label = "15 minutes" }, 
      new Duration() { Value = 30, Label = "30 minutes" }, 
      new Duration() { Value = 45, Label = "45 minutes" }, 
      new Duration() { Value = 60, Label = "1 hour" }, 
      new Duration() { Value = 90, Label = "1 hour and half" } 
    };
  this.listTime.DataSource = durations;
  this.listTime.DisplayMember = "Label";
  this.listTime.ValueMember = "Value";
  </code></pre>
  
  <p>Everything works fine and the labels are show.
  When i go to read the selected value, I am not able to recover the value of the selected item.</p>
  
  <p>I was expecting to be able to do this:</p>
  
  <pre><code>int value = listTime.SelectedItems[0].Value;
  </code></pre>
  
  <p>or at least this:</p>
  
  <pre><code>Duration value = listTime.SelectedItems[0];
  </code></pre>
  
  <p>but this gives me error, what I am doing wrong? How is the right way to get the value of the selected item on the <code>ListBox</code>?</p>