The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Missing hierarchical OnPropertyChanged notifications in ES2008

Last post 08-01-2008, 7:54 PM by Mike.Griffin. 3 replies.
Sort Posts: Previous Next
  •  07-23-2008, 8:54 AM 10351

    Missing hierarchical OnPropertyChanged notifications in ES2008

    The new setters for hierarchical properties are handy, but they're missing the property changed notifcation that makes them work properly in WPF.  When one of the properties gets reset, it should raise a PropertyChanged event so the bindings will know to get the new value from the property (which will re-create it from the DB).

    After a quick check, it appears that Zero to Many, One to One, and Many to Many are missing property changed notification while Many to One has it.  Here's the current MyGen template for zero to many:

    Code:
    set 
    { 
    	if (value != null) throw new Exception("'value' Must be null");
    	
    	if (this._<%=objName%> != null) 
    	{ 
    		this.RemovePostSave("<%=objName%>"); 
    		this._<%=objName%> = null; 
    	}
    }

    Here's what it should be:

    Code:
    set 
    { 
    	if (value != null) throw new Exception("'value' Must be null");
     
    	if (this._<%=objName%> != null) 
    	{ 
    		this.RemovePostSave("<%=objName%>"); 
    		this._<%=objName%> = null;
    		this.OnPropertyChanged("<%=objName%>"); // <-- new line
    	}
    }

    I have this fixed in my local templates, but you'll probably want to get this into the release version templates for the next release.

  •  07-23-2008, 9:25 AM 10352 in reply to 10351

    Re: Missing hierarchical OnPropertyChanged notifications in ES2008

    Actually, I guess the correct version would be the following:

    Code:
    set 
    { 
    	if (value != null) throw new Exception("'value' Must be null");
     
    	if (this._<%=objName%> != null) 
    	{ 
    		this.RemovePostSave("<%=objName%>"); 
    		this._<%=objName%> = null;
    		<%if(SupportINotifyChanged){%>this.OnPropertyChanged("<%=objName%>");<%}%>
    	}
    }
  •  07-23-2008, 7:06 PM 10356 in reply to 10352

    Re: Missing hierarchical OnPropertyChanged notifications in ES2008

    Thank you. You are correct, we are adding this fix and it will be included in our 1st ES 2008 maintenance release.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  08-01-2008, 7:54 PM 10522 in reply to 10356

    Re: Missing hierarchical OnPropertyChanged notifications in ES2008

    These fixes have been made and will be in the maintenance release, thank you.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML