daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public partial class Window1 : Window
  2.  {
  3.      public Window1()
  4.      {
  5.          InitializeComponent();
  6.          this.DataContext = new Person { FirstName="Rowan" };
  7.      }
  8.  }
  9.  
  10.  public class Person
  11.  {
  12.      public String FirstName { get; set; }
  13.      public String LastName { get; set; }
  14.  }
  15.    
  16. this.DataContext = new Person { FirstName="Rowan" };
  17.    
  18. Person a_person = new Person { FirstName="Rowan" };
  19.    
  20. public partial class Window1 : Window
  21.  {
  22.      Person GoodPerson{get;set;}
  23.      public Window1()
  24.      {
  25.          InitializeComponent();
  26.          GoodPerson = new Person { FirstName="Rowan" };
  27.          this.DataContext = GoodPerson;
  28.          GoodPerson.FirstName="Rand";
  29.      }
  30.  }
  31.    
  32. Person p = (Person)DataContext;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top