You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/AnalyzerReleases.Shipped.md
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Diagnostics/Analyzers/UseGeneratedDependencyPropertyOnManualPropertyAnalyzer.cs
+71-12Lines changed: 71 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,9 @@ public sealed class UseGeneratedDependencyPropertyOnManualPropertyAnalyzer : Dia
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -420,4 +420,30 @@ internal static class DiagnosticDescriptors
420
420
isEnabledByDefault:true,
421
421
description:"All dependency property fields should declare property types in metadata matching the type of their wrapping properties, or with a valid type conversion between the two.",
/// <c>The field '{0}' is registering a dependency property, but its default value is set to 'null', which is not compatible with the property type '{1}' declared in metadata (consider changing the default value, implementing the 'Get(ref object)' partial method to handle the type mismatch, or suppressing the diagnostic if this is the intended behavior)</c>.
title:"Invalid 'null' default value in dependency property field metadata",
430
+
messageFormat:"The field '{0}' is registering a dependency property, but its default value is set to 'null', which is not compatible with the property type '{1}' declared in metadata (consider changing the default value, implementing the 'Get(ref object)' partial method to handle the type mismatch, or suppressing the diagnostic if this is the intended behavior)",
431
+
category:DiagnosticCategory,
432
+
defaultSeverity:DiagnosticSeverity.Warning,
433
+
isEnabledByDefault:true,
434
+
description:"All dependency property fields setting an explicit default value in metadata should do so with an expression of a type comparible with the property type. Alternatively, the 'Get(ref object)' method should be implemented to handle the type mismatch.",
/// <c>The field '{0}' is registering a dependency property, but its default value has type '{1}', which is not compatible with the property type '{2}' declared in metadata (consider fixing the default value, or implementing the 'Get(ref object)' partial method to handle the type mismatch)</c>.
title:"Invalid default value type in dependency property field metadata",
443
+
messageFormat:"The field '{0}' is registering a dependency property, but its default value has type '{1}', which is not compatible with the property type '{2}' declared in metadata (consider fixing the default value, or implementing the 'Get(ref object)' partial method to handle the type mismatch)",
444
+
category:DiagnosticCategory,
445
+
defaultSeverity:DiagnosticSeverity.Warning,
446
+
isEnabledByDefault:true,
447
+
description:"All dependency property fields setting an explicit default value in metadata should do so with an expression of a type comparible with the property type. Alternatively, the 'Get(ref object)' method should be implemented to handle the type mismatch.",
Copy file name to clipboardExpand all lines: components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.Tests/Test_Analyzers.cs
+92-2Lines changed: 92 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2246,13 +2246,13 @@ public sealed partial class PlayerControl : UserControl
2246
2246
{|WCTDP0027:nameof(PlayButtonVisible)|},
2247
2247
{|WCTDP0030:typeof(bool)|},
2248
2248
typeof(PlayerControl),
2249
-
new PropertyMetadata(Visibility.Visible));
2249
+
new PropertyMetadata({|WCTDP0032:Visibility.Visible|}));
2250
2250
2251
2251
public static readonly DependencyProperty VolumeVisibleProperty = DependencyProperty.Register(
2252
2252
nameof(VolumeVisible),
2253
2253
{|WCTDP0030:typeof(bool)|},
2254
2254
typeof(PlayerControl),
2255
-
new PropertyMetadata(Visibility.Visible));
2255
+
new PropertyMetadata({|WCTDP0032:Visibility.Visible|}));
2256
2256
2257
2257
public Visibility PlayButtonVisible
2258
2258
{
@@ -2927,6 +2927,96 @@ public class MyOtherObject : DependencyObject;
0 commit comments