title: Possible way of initializing constructor/object
body: <p>I'm beginner when it comes to OOP. Yesterday I was trying to read some mvvm/wpf examples and of course I get into trouble... I have some problem with understand some of code below:</p>
  
  <pre><code>{
  class Person
  {
  public string FirstName { get; set; }
  public string LastName { get; set; }
  public string Addres { get; set; }
  }
  </code></pre>
  
  <p>This is just normal Person class, nothing really unusal here. The problem is that I can't understand below code:</p>
  
  <pre><code>private void SayHi_Click(object sender, RoutedEventArgs e)
  {
  Person person = new Person
  {
  FirstName=FirstName.Text,
  LastName=LastName.Text,
  Addres=Address.Text
  };
  </code></pre>
  
  <p>The part that I do not understand is:</p>
  
  <pre><code>   Person person = new Person
      {
      FirstName=FirstName.Text,
      LastName=LastName.Text,
      Addres=Address.Text
      };
  </code></pre>
  
  <p>I'm not sure what this is exactly. I thought that every new object should be initialized like this one: Class class = new Class();. Why there is no () after  "new Person"? Instead of () we have {}. I know that we can use default, parameterized, static and private construcotrs. Could someone explain this to me? Similar situation in below tutorial from CodeProject:</p>
  
  <p><a href="http://www.codeproject.com/Articles/165368/WPF-MVVM-Quick-Start-Tutorial" rel="nofollow">http://www.codeproject.com/Articles/165368/WPF-MVVM-Quick-Start-Tutorial</a></p>
  
  <p>We have a Song Class </p>
  
  <pre><code>public class Song
  {
  #region Members
  string _artistName;
  string _songTitle;
  #endregion
  
  #region Properties
  /// The artist name.
  public string ArtistName
  {
  get { return _artistName; }
  set { _artistName = value; }
  }
  
  /// The song title.
  public string SongTitle
  {
  get { return _songTitle; }
  set { _songTitle = value; }
  }
  #endregion
  }
  </code></pre>
  
  <p>And we have of course View Model for this class:</p>
  
  <pre><code>public class SongViewModel
  {
  Song _song;
  
  public Song Song
  {
  get
  {
  return _song;
  }
  set
  {
  _song = value;
  }
  }
  
  public string ArtistName
  {
  get { return Song.ArtistName; }
  set { Song.ArtistName = value; }
  }
  }
  </code></pre>
  
  <p>And again, this part of code is something that I can't understand:</p>
  
  <pre><code>public class SongViewModel
  {
  Song _song;
  
  public Song Song
  </code></pre>
  
  <p>What this "Song _song;" is? This is object of Song Class? And this Property "Song Song" is also wierd... Probably I have a lack of knowledge</p>