Skip to content

Commit 524fa32

Browse files
authored
Merge pull request #151 from FmgLib/149-mauimarkupattribute-animate-extension-method-error
#149
2 parents 048c289 + 753da52 commit 524fa32

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/FmgLib.MauiMarkup.Generator/Extensions/ExtensionGenerator.AnimateTo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ void GenerateExtensionMethod_AnimateTo(PropInfo info, string transformationName)
1313
public static Task<bool> Animate{info.propertyName}To<T>(this T self, {info.propertyTypeName} value, uint length = 250, Easing? easing = null)
1414
where T : {info.MainSymbolName}");
1515

16+
var callBackSetValue = info.IsBindableProperty ? $"self.SetValue({info.BindablePropertyName}, actValue);" : $"self.{info.propertyName} = actValue;";
1617

1718
builder.Append($@"
1819
{{
1920
{info.propertyTypeName} fromValue = self.{info.propertyName};
2021
var transform = (double t) => Transformations.{transformationName}(fromValue, value, t);
21-
var callback = ({info.propertyTypeName} actValue) => {{ self.{info.propertyName} = actValue; }};
22+
var callback = ({info.propertyTypeName} actValue) => {{ {callBackSetValue} }};
2223
return Transformations.AnimateAsync<{info.propertyTypeName}>(self, ""Animate{info.propertyName}To"", transform, callback, length, easing);
2324
}}
2425
");

src/FmgLib.MauiMarkup.Generator/Extensions/ExtensionGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void GenerateClassExtensionBody()
100100
.ToList();
101101

102102
var properties = propertiesMap
103-
.Where(_ => (!_.IsReadOnly && !(_.SetMethod == null || _.SetMethod?.DeclaredAccessibility == Accessibility.Protected || _.SetMethod?.DeclaredAccessibility == Accessibility.Private)) || bindablePropertyNames.Any(e => e.Equals(_.Name)))
103+
.Where(_ => (!_.IsReadOnly && !(_.SetMethod == null || _.SetMethod?.DeclaredAccessibility == Accessibility.Protected || _.SetMethod?.DeclaredAccessibility == Accessibility.Private || _.SetMethod?.DeclaredAccessibility == Accessibility.Internal)) || bindablePropertyNames.Any(e => e.Equals(_.Name)))
104104
.ToList();
105105

106106
var readOnlyListProperties = propertiesMap

src/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageId>FmgLib.MauiMarkup</PackageId>
1212
<Summary>FmgLib.MauiMarkup with C# Markup classes and fluent helper methods</Summary>
1313
<Title>FmgLib.MauiMarkup</Title>
14-
<Version>8.8.5.1</Version>
14+
<Version>8.8.6</Version>
1515
<Authors>FmgYazılım</Authors>
1616
<Company>Fmg Yazılım</Company>
1717
<Copyright>©2024</Copyright>

0 commit comments

Comments
 (0)