title: ListView Binding with "IsSelected" Property of ListViewItem
body: <p>I have following class</p>
  <pre><code>   public abstract class AbsTrinityEvent
     {
      public event IsSelected OnSelectedEvent; 
  
      bool _IsSelected;
      ITrinityEvent _objTrinityEvent;
      public AbsTrinityEvent(ITrinityEvent objTrinityEvent)
      {
          _objTrinityEvent = objTrinityEvent;
      }
  
  
      public ITrinityEvent TrinityEventObj
      {
  
          set
          {
              _objTrinityEvent = value;
          }
  
          get
          {
              return _objTrinityEvent;
          }
      }
  
      public int EventRefID
      {
          get
          {
              return _objTrinityEvent.EventRefID;
          }
      }
  
      public string EventDescription
      {
          get
          {
              return _objTrinityEvent.EventDescription;
          }
      }
  
      public string EventDateTime
      {
          get
          {
              return _objTrinityEvent.EventDateTime;
          }
      }
  
      public string Site
      {
          get
          {
              return _objTrinityEvent.Site;
          }
      }
  
      public int Priority
      {
          get
          {
              return _objTrinityEvent.Priority;
          }
      }
  
      public string DeviceName
      {
          get
          {
              return _objTrinityEvent.DeviceName;
          }
      }
  
      public bool IsAlarm
      {
          get
          {
              return _objTrinityEvent.IsAlarm;
          }
      }
  
      public string OperatorName
      {
          get
          {
              return _objTrinityEvent.OperatorName;
          }
      }
  
      public int SiteID
      {
          get
          {
              return _objTrinityEvent.SiteID;
          }
      }
  
      public int EventSrcInstanceID
      {
          get
          {
              return _objTrinityEvent.EventSrcInstanceID;
          }
      }
  
  
      public int EventSrcInstanceMasterDeviceID
      {
          get
          {
              return _objTrinityEvent.EventSrcInstanceMasterDeviceID;
          }
      }
  
      public bool IsSelected
      {
          set
          {
              _IsSelected = value;
              ItemSelectedEventArgs obj = new ItemSelectedEventArgs(_objTrinityEvent);
              OnSelectedEvent(this, obj);                                        
          }
          get
          {
              return _IsSelected;
          }
      }      
          
  }
  
  public class ItemSelectedEventArgs : EventArgs
  {
      private ITrinityEvent _objItem;
  
      public ItemSelectedEventArgs(ITrinityEvent objItem)
      {
          _objItem = objItem;
  
      }
  
      public ITrinityEvent SlectedNode
      {
          get
          {
              return _objItem;
          }
      }
  }
  
  public sealed class TrinityEventData : AbsTrinityEvent
  {
      public TrinityEventData(ITrinityEvent objEvent)
          : base(objEvent)
      {
      }
  }
  </code></pre>
  <p>I am binding this to my listview in code behind ( Not in XAML ) using following function</p>
  <pre><code>    public void SetupColumnsForUnAcklist()
      {
          //Create Columns for listview
          GridView grdView = new GridView();
          grdView.Columns.Add(new GridViewColumn() { DisplayMemberBinding = new Binding() { Path = new PropertyPath(&quot;EventDescription&quot;) }, Header = &quot;Description&quot; });
          grdView.Columns.Add(new GridViewColumn() { DisplayMemberBinding = new Binding() { Path = new PropertyPath(&quot;EventDateTime&quot;) }, Header = &quot;Date:Time&quot; });
          grdView.Columns.Add(new GridViewColumn() { DisplayMemberBinding = new Binding() { Path = new PropertyPath(&quot;Site&quot;) }, Header = &quot;Site&quot; });
          grdView.Columns.Add(new GridViewColumn() { DisplayMemberBinding = new Binding() { Path = new PropertyPath(&quot;DeviceName&quot;) }, Header = &quot;Device&quot; });
          grdView.Columns.Add(new GridViewColumn() { DisplayMemberBinding = new Binding() { Path = new PropertyPath(&quot;Priority&quot;) }, Header = &quot;Priority&quot; });
          
          
  
          lstview_Unack.View = grdView;                   
          
          //Do Binding 
          if (_alarmUnAckList != null)
          {
              
              lstview_Unack.SetBinding(ListView.ItemsSourceProperty, new Binding() { Source = _alarmUnAckList });
              lstview_Unack.SetBinding(ListView.IsSelectedProperty, new Binding() { Path = new PropertyPath(&quot;IsSelected&quot;) });
          }
          
          lstview_Unack.ContextMenu = contextMenu;
  
          foreach (GridViewColumn col in grdView.Columns)
          {
              comboColumnList.Items.Add(col.Header as string);
          }           
      }     
  </code></pre>
  <p>My problem is, I want bind ListViewItem &quot;IsSelected&quot; Property to the TrinityEventData's &quot;IsSelected&quot; Property. How I should I do it in code behind?</p>