title: Two different classes binding to same listview in WPF
body: <p>I have ItemsSource on ListView set to class Mail. I want to have one column with property from other class. How to bind that column to other class? I checked other answers, but didnt fint suitable one. </p>
  
  <p>And XAML is sth im learning, so code-behind is what is use the most in WPF.</p>
  
  <p>Code:</p>
  
  <pre><code>public class Mail
  {
      [Key]
      public int IDMail { get; set; }
      public string prop1{ get; set; }
      public string prop2 { get; set; }
      public DateTime prop3{ get; set; }
      public Sender senderID{ get; set; }      
  }
  
  public class Sender
  {
      [Key]
      public int IDSender { get; set; }
      public string propSender1{ get; set; }
      public string propSender2{ get; set; }  
  }
  </code></pre>
  
  <p>XAML: </p>
  
  <pre><code> &lt;ListView x:Name="listView_knjizenaPosta" Background="#FFDEDEDE" HorizontalContentAlignment="Center"   HorizontalAlignment="Center" Height="293" Margin="0,69,0,260" VerticalAlignment="Center" Width="1018" FontSize="16" SelectionChanged="listView_knjizenaPosta_SelectionChanged" FontFamily="Verdana" MouseDoubleClick="listView_knjizenaPosta_MouseDoubleClick"&gt;
              &lt;ListView.ItemContainerStyle&gt;
                  &lt;Style TargetType="{x:Type ListViewItem}"&gt;
                      &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
                  &lt;/Style&gt;
              &lt;/ListView.ItemContainerStyle&gt;
              &lt;ListView.View&gt;
                  &lt;GridView&gt;
  
                      &lt;GridViewColumn Header="ID" Width="50" DisplayMemberBinding="{Binding IDMail}"/&gt;
                      &lt;GridViewColumn Header="Prop1" Width="250" DisplayMemberBinding="{Binding prop1}" /&gt;
                      &lt;GridViewColumn Header="Prop3" Width="185" DisplayMemberBinding="{Binding prop3, StringFormat=dd.MM.yyyy HH:mm:ss}" /&gt;                       
                      &lt;GridViewColumn Header="PropSender2" Width="250" DisplayMemberBinding="{Binding WHAT GOES HERE?}" /&gt;
  
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
          &lt;/ListView&gt;
  </code></pre>