title: If statment on button content . WPF
body: <p>i have listview one button( default content == "Add") and 1 textbox. On list view double click event buttons.Content=="Edit" and text box fills with information from listview.</p>
  
  <p>this if statment does not work correctly </p>
  
  <pre><code>            if (btnAddFloor.Content == "Add")
              {
                  HProDataContext db = new HProDataContext();
                  floor f = new floor { floorname = txtFloorName.Text };
                  db.floors.InsertOnSubmit(f);
                  db.SubmitChanges();
                  RefreshListViewFloor();
              }
              else
              {
                  int currentID = Convert.ToInt32(listViewFloors.SelectedValue);
  
                  HProDataContext db = new HProDataContext();
                  floor f = db.floors.Single(p =&gt; p.id == currentID);
                  f.floorname = txtFloorName.Text;
                  db.SubmitChanges();
                  RefreshListViewFloor();
                  txtFloorName.Text = null;
                  RefreshListViewRoom();
              }
  </code></pre>
  
  <p>and on btnAddFloor.Content == "Add" is green underline
  can anyone help me?</p>
  
  <p>XAML</p>
  
  <pre><code>    &lt;GroupBox Header="Floors" Height="287" HorizontalAlignment="Left" Margin="12,32,0,0" Name="GroupBoxFloors" VerticalAlignment="Top" Width="342"&gt;
          &lt;Grid&gt;
              &lt;Button Content="Add" Height="23" HorizontalAlignment="Left" Margin="169,37,0,0" Name="btnAddFloor" VerticalAlignment="Top" Width="75" Click="btnAddFloor_Click" /&gt;
              &lt;ListView Height="192" HorizontalAlignment="Left" Margin="6,66,0,0" Name="listViewFloors" VerticalAlignment="Top" Width="318" ItemsSource="{Binding FloorCollection}" SelectedValuePath="ID" MouseDoubleClick="listViewFloors_MouseDoubleClick"&gt;
                  &lt;ListView.View &gt;
                      &lt;GridView&gt;
                          &lt;GridViewColumn Header="ID" Width="60" DisplayMemberBinding="{Binding ID}"/&gt;
                          &lt;GridViewColumn Header="FloorName" Width="200" DisplayMemberBinding="{Binding FloorName}"/&gt;
  
                      &lt;/GridView&gt;
                  &lt;/ListView.View&gt;
              &lt;/ListView&gt;
              &lt;TextBox Height="23" HorizontalAlignment="Left" Margin="6,37,0,0" Name="txtFloorName" VerticalAlignment="Top" Width="157" TextChanged="txtFloorName_TextChanged" /&gt;
              &lt;Button Content="Remove" Height="23" HorizontalAlignment="Left" Margin="249,37,0,0" Name="btnRemoveFloor" VerticalAlignment="Top" Width="75" Click="btnRemoveFloor_Click" /&gt;
              &lt;Label Content="Floor Name" Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" VerticalAlignment="Top" /&gt;
          &lt;/Grid&gt;
      &lt;/GroupBox&gt;
  </code></pre>