File tree Expand file tree Collapse file tree 2 files changed +29
-7
lines changed
Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 99
1010 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
1111 <PackageId >SimpleViewModel</PackageId >
12- <Version >0.9.6</Version >
12+ <Version >0.9.6.1 </Version >
1313 <Authors >Derek Gooding</Authors >
1414 <Company >Derek Gooding</Company >
1515 <Description >
Original file line number Diff line number Diff line change @@ -135,15 +135,37 @@ private static string ToPascal(string name)
135135
136136 private static string ? GetCanExecuteMethodName ( IMethodSymbol method )
137137 {
138- var attribute = method . GetAttributes ( ) . First ( x => x . AttributeClass ? . Name == "CommandAttribute" ) ;
139- var argument = attribute . NamedArguments . First ( arg => arg . Key == "CanExecuteMethodName" ) ;
140- return argument . Value . Value ? . ToString ( ) ;
138+ foreach ( var attr in method . GetAttributes ( ) )
139+ {
140+ if ( attr . AttributeClass ? . Name == "CommandAttribute" )
141+ {
142+ foreach ( var namedArg in attr . NamedArguments )
143+ {
144+ if ( namedArg . Key == "CanExecuteMethodName" )
145+ {
146+ return namedArg . Value . Value ? . ToString ( ) ;
147+ }
148+ }
149+ }
150+ }
151+ return null ;
141152 }
142153
143154 private static string ? GetOnChangeMethodName ( IFieldSymbol field )
144155 {
145- var attribute = field . GetAttributes ( ) . First ( x => x . AttributeClass ? . Name == "BindAttribute" ) ;
146- var argument = attribute . NamedArguments . First ( arg => arg . Key == "OnChangeMethodName" ) ;
147- return argument . Value . Value ? . ToString ( ) ;
156+ foreach ( var attr in field . GetAttributes ( ) )
157+ {
158+ if ( attr . AttributeClass ? . Name == "BindAttribute" )
159+ {
160+ foreach ( var namedArg in attr . NamedArguments )
161+ {
162+ if ( namedArg . Key == "OnChangeMethodName" )
163+ {
164+ return namedArg . Value . Value ? . ToString ( ) ;
165+ }
166+ }
167+ }
168+ }
169+ return null ;
148170 }
149171}
You can’t perform that action at this time.
0 commit comments