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: src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests/BindablePropertyAttributeSourceGeneratorTests/CommonUsageTests.cs
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -663,13 +663,17 @@ public async Task GenerateBindableProperty_WithInitializers_GeneratesCorrectCode
663
663
$$"""
664
664
using CommunityToolkit.Maui;
665
665
using Microsoft.Maui.Controls;
666
+
using System;
666
667
667
668
namespace {{defaultTestNamespace}};
668
669
669
670
public partial class {{defaultTestClassName}} : View
670
671
{
671
672
[BindablePropertyAttribute]
672
673
public partial string Text { get; set; } = "Initial Value";
674
+
675
+
[BindablePropertyAttribute]
676
+
public partial TimeSpan CustomDuration { get; set; } = TimeSpan.FromSeconds(30);
673
677
}
674
678
""";
675
679
@@ -689,15 +693,30 @@ public partial class {{defaultTestClassName}}
public partial System.TimeSpan CustomDuration { get => __initializingCustomDuration ? field : (System.TimeSpan)GetValue(CustomDurationProperty); set => SetValue(CustomDurationProperty, field = value); }
Copy file name to clipboardExpand all lines: src/CommunityToolkit.Maui.SourceGenerators.Internal/Generators/BindablePropertyAttributeSourceGenerator.cs
0 commit comments