File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ public static MemberDeclarationSyntax GetPropertySyntax(PropertyInfo propertyInf
146
146
{
147
147
ImmutableArray < StatementSyntax > . Builder setterStatements = ImmutableArray . CreateBuilder < StatementSyntax > ( ) ;
148
148
149
+ // Add the OnPropertyChanging() call first:
150
+ //
151
+ // On<PROPERTY_NAME>Changing(value);
152
+ setterStatements . Add (
153
+ ExpressionStatement (
154
+ InvocationExpression ( IdentifierName ( $ "On{ propertyInfo . PropertyName } Changing") )
155
+ . AddArgumentListArguments ( Argument ( IdentifierName ( "value" ) ) ) ) ) ;
156
+
149
157
// Gather the statements to notify dependent properties
150
158
foreach ( string propertyName in propertyInfo . PropertyChangingNames )
151
159
{
@@ -192,6 +200,14 @@ public static MemberDeclarationSyntax GetPropertySyntax(PropertyInfo propertyInf
192
200
Argument ( LiteralExpression ( SyntaxKind . StringLiteralExpression , Literal ( propertyInfo . PropertyName ) ) ) ) ) ) ;
193
201
}
194
202
203
+ // Add the OnPropertyChanged() call:
204
+ //
205
+ // On<PROPERTY_NAME>Changed(value);
206
+ setterStatements . Add (
207
+ ExpressionStatement (
208
+ InvocationExpression ( IdentifierName ( $ "On{ propertyInfo . PropertyName } Changed") )
209
+ . AddArgumentListArguments ( Argument ( IdentifierName ( "value" ) ) ) ) ) ;
210
+
195
211
// Gather the statements to notify dependent properties
196
212
foreach ( string propertyName in propertyInfo . PropertyChangedNames )
197
213
{
You can’t perform that action at this time.
0 commit comments