public void New() { List<CustomPropertyInfoHelper> propInfos =this.GetPropertyInfos() ; foreach (CustomPropertyInfoHelper key in propInfos) { this.NewPropertyValue(key._name); } //设置对象为新对象,且未修改 IsNew = true; IsModified = false; IsInit = true; } #endregion
private static void OnIsInitChanged(DependencyObject dp, DependencyPropertyChangedEventArgs args) { GeneralObject go = (GeneralObject)dp; //如果指明Path改变时,不加载数据,则只有当外界要求,加载数据时,才加载 if (go.IsInit) { go.New(); } }