コード例 #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
ファイル: MainWindow.xaml.cs プロジェクト: TLevitt/DryLogic
    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) =>
      //{

      //};
    }