@@ -75,6 +75,10 @@ public sealed partial class ReactiveGenerator
7575 _ => "public" ,
7676 } ;
7777
78+ // Get Overridable value from the attribute
79+ attributeData . TryGetNamedArgument ( "Overridable" , out bool ? overridableArgument ) ;
80+ var overridable = overridableArgument == true ? "virtual" : string . Empty ;
81+
7882 token . ThrowIfCancellationRequested ( ) ;
7983
8084 // Get the property type and name
@@ -214,7 +218,8 @@ public sealed partial class ReactiveGenerator
214218 isReferenceTypeOrUnconstraindTypeParameter ,
215219 includeMemberNotNullOnSetAccessor ,
216220 forwardedAttributesString ,
217- accessModifier ) ,
221+ accessModifier ,
222+ overridable ) ,
218223 builder . ToImmutable ( ) ) ;
219224 }
220225
@@ -282,7 +287,7 @@ private static string GetPropertySyntax(PropertyInfo propertyInfo)
282287$$ """
283288 /// <inheritdoc cref="{{ propertyInfo . FieldName }} "/>
284289 {{ propertyAttributes }}
285- {{ propertyInfo . TargetVisibility }} {{ propertyInfo . TypeNameWithNullabilityAnnotations }} {{ propertyInfo . PropertyName }}
290+ {{ propertyInfo . TargetVisibility }} {{ propertyInfo . Overridable }} {{ propertyInfo . TypeNameWithNullabilityAnnotations }} {{ propertyInfo . PropertyName }}
286291 {
287292 get => {{ propertyInfo . FieldName }} ;
288293 [global::System.Diagnostics.CodeAnalysis.MemberNotNull("{{ propertyInfo . FieldName }} ")]
@@ -295,7 +300,7 @@ private static string GetPropertySyntax(PropertyInfo propertyInfo)
295300$$ """
296301 /// <inheritdoc cref="{{ propertyInfo . FieldName }} "/>
297302 {{ propertyAttributes }}
298- {{ propertyInfo . TargetVisibility }} {{ propertyInfo . TypeNameWithNullabilityAnnotations }} {{ propertyInfo . PropertyName }} { get => {{ propertyInfo . FieldName }} ; {{ setModifier }} set => this.RaiseAndSetIfChanged(ref {{ propertyInfo . FieldName }} , value); }
303+ {{ propertyInfo . TargetVisibility }} {{ propertyInfo . Overridable }} {{ propertyInfo . TypeNameWithNullabilityAnnotations }} {{ propertyInfo . PropertyName }} { get => {{ propertyInfo . FieldName }} ; {{ setModifier }} set => this.RaiseAndSetIfChanged(ref {{ propertyInfo . FieldName }} , value); }
299304""" ;
300305 }
301306
0 commit comments