Skip to content

Commit 07d0087

Browse files
Use "null" instead of string.IsNullOrEmpty()
1 parent 1ba82b4 commit 07d0087

File tree

1 file changed

+1
-1
lines changed
  • src/CommunityToolkit.Maui.SourceGenerators.Internal/Models

1 file changed

+1
-1
lines changed

src/CommunityToolkit.Maui.SourceGenerators.Internal/Models/Records.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CommunityToolkit.Maui.SourceGenerators.Internal.Models;
66
record BindablePropertyModel(string PropertyName, ITypeSymbol ReturnType, ITypeSymbol DeclaringType, string DefaultValue, string DefaultBindingMode, string ValidateValueMethodName, string PropertyChangedMethodName, string PropertyChangingMethodName, string CoerceValueMethodName, string DefaultValueCreatorMethodName, string NewKeywordText, bool IsReadOnlyBindableProperty, string? SetterAccessibility, bool HasInitializer)
77
{
88
// When both a DefaultValueCreatorMethodName and an initializer are provided, we implement the DefaultValueCreator method and the ignore the partial Property initializer
9-
public bool ShouldUsePropertyInitializer => HasInitializer && string.IsNullOrEmpty(DefaultValueCreatorMethodName);
9+
public bool ShouldUsePropertyInitializer => HasInitializer && DefaultValueCreatorMethodName is "null";
1010
public string BindablePropertyName => $"{PropertyName}Property";
1111
public string BindablePropertyKeyName => $"{char.ToLower(PropertyName[0])}{PropertyName[1..]}PropertyKey";
1212
public string EffectiveDefaultValueCreatorMethodName => ShouldUsePropertyInitializer ? $"__createDefault{PropertyName}" : DefaultValueCreatorMethodName;

0 commit comments

Comments
 (0)