Skip to content

Commit

Permalink
Merge pull request #151 from FmgLib/149-mauimarkupattribute-animate-e…
Browse files Browse the repository at this point in the history
…xtension-method-error

#149
  • Loading branch information
gonultasmf authored Nov 17, 2024
2 parents 048c289 + 753da52 commit 524fa32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ void GenerateExtensionMethod_AnimateTo(PropInfo info, string transformationName)
public static Task<bool> Animate{info.propertyName}To<T>(this T self, {info.propertyTypeName} value, uint length = 250, Easing? easing = null)
where T : {info.MainSymbolName}");

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

builder.Append($@"
{{
{info.propertyTypeName} fromValue = self.{info.propertyName};
var transform = (double t) => Transformations.{transformationName}(fromValue, value, t);
var callback = ({info.propertyTypeName} actValue) => {{ self.{info.propertyName} = actValue; }};
var callback = ({info.propertyTypeName} actValue) => {{ {callBackSetValue} }};
return Transformations.AnimateAsync<{info.propertyTypeName}>(self, ""Animate{info.propertyName}To"", transform, callback, length, easing);
}}
");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void GenerateClassExtensionBody()
.ToList();

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

var readOnlyListProperties = propertiesMap
Expand Down
2 changes: 1 addition & 1 deletion src/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageId>FmgLib.MauiMarkup</PackageId>
<Summary>FmgLib.MauiMarkup with C# Markup classes and fluent helper methods</Summary>
<Title>FmgLib.MauiMarkup</Title>
<Version>8.8.5.1</Version>
<Version>8.8.6</Version>
<Authors>FmgYazılım</Authors>
<Company>Fmg Yazılım</Company>
<Copyright>©2024</Copyright>
Expand Down

0 comments on commit 524fa32

Please sign in to comment.