Пример #1
0
    public MainWindow()
    {
      InitializeComponent();

      this.employee = new Employee();


      //the DynamicProxy is a dynamic object.  It's purpose is to reroute binding gets and sets to the StringValue 
      //of the DomainObject's DomainProperties.  It also exposes a couple of properties and methods on the DomainObject,
      //like IsValid and GetFirstInvalidMessage, but these are just shortcuts to exposing them explicitly on the DomainObject
      this.employeeProxy = new DryLogicProxy(employee);

      //supress validation while the form is loading - the bindings update the source values causing the validation to fire on a fresh form.
      //Set this to true to suppress validation messages until after an input gets data.
      this.employeeProxy.IsValidationSuppressed = true;



      InitializeComponent();
      PnlForm.DataContext = this.employeeProxy;
      this.employee.HireDate = DateTime.Today;
      //test toolkit's DateTimePicker resetting the property value
      //this.employee.DomainContainer.PropertyChanged += (sender, e) =>
      //{

      //};
    }
Пример #2
0
 public EmployeeViewModel()
 {
   MyEmployee = new Employee();
 }
Пример #3
0
 public void SetUp()
 {
   Employee = new Employee();
   EmployeeProxy = new DryLogicProxy(Employee);
 }
Пример #4
0
 public ActionResult Create_SimpleType(Employee employee)
 {
   return View(employee);
 }
Пример #5
0
 public void Setup()
 {
   Employee = new Employee();
 }