title: MonoTouch: UISegmentedControl Select a segment that is already selected
body: <p>I am attempting to use a <code>UISegmentedControl</code> to control the sort order of my table, in particular I want to register a tap on a segment that is already selected (to inverse my sort). As such, I am trying to raise an <code>UIControlEvent.ValueChanged</code> event whenever any segment is tapped.</p>
  
  <p>I have overridden <code>SelectedSegment</code> from <code>UISegmentedControl</code> and am using this custom class for my element in xcode, however, it appears as though this code is not called when the the Segment control is tapped (It <strong>is</strong> called when the view is loaded though =S). </p>
  
  <pre><code>[Register("ReselectableSegment")]
  public class ReselectableSegment : UISegmentedControl
  {
      static Selector selInit       = new Selector("init");  
  
      [Export("init")]  
      public ReselectableSegment()  
          : base(NSObjectFlag.Empty)  
      {  
          Handle = Messaging.IntPtr_objc_msgSend(this.Handle,  
              selInit.Handle);  
      }  
  
      public ReselectableSegment (IntPtr handle) : base(handle){}
  
      public override int SelectedSegment
      {
          [Export ("SelectedSegment:")]
          set { 
              if(this.SelectedSegment == value)
                  this.SendActionForControlEvents(UIControlEvent.ValueChanged);
  
              base.SelectedSegment = value;
          }
      }
  }
  </code></pre>
  
  <p>This question has been asked before at: <a href="https://stackoverflow.com/questions/1620972/uisegmentedcontrol-register-taps-on-selected-segment">UISegmentedControl register taps on selected segment</a>, however that question is for ObjC and this question is for C#/Monotouch.</p>