コード例 #1
0
ファイル: Host.cs プロジェクト: HVCCTechHelp/HVCCcheckIn
        public static IMvvmBinder GetNewPropertyDetailView(object arg)
        {
            ////IDataContext dc = new UnitTextConnectionDataContext();
            IDataContext dc = new HVCC.Shell.Models.HVCCDataContext() as IDataContext;
            IViewModel   vm = new PropertiesDetailsViewModel(dc)
            {
                Caption = "Properties"
            };
            IView v = new HVCC.Shell.Views.PropertyDetailsView(vm);

            return(new MvvmBinder(dc, v, vm));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void view_ValidateRow(object sender, GridRowValidationEventArgs e)
        {
            PropertiesDetailsViewModel vm = this.DataContext as PropertiesDetailsViewModel;

            Property row = e.Row as Property;

            //if (null != row)
            if (!e.IsValid)
            {
                e.IsValid      = false;
                e.ErrorType    = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical;
                e.ErrorContent = "The highlighted field cannot be blank";
                e.SetError(e.ErrorContent);
            }
        }