Skip to content

Commit 40aee12

Browse files
authored
Merge pull request #150 from FmgLib/149-mauimarkupattribute-animate-extension-method-error
149 mauimarkupattribute animate extension method error
2 parents 0e74c8c + 753da52 commit 40aee12

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Mustafa Gönültaş
3+
Copyright (c) 2024 FmgLib
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "FmgLib.MauiMarkup"), to deal

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/Extensions/ResourceDictionaryExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static T RemoveResource<T>(this T self, string key) where T : Microsoft.M
4444
return self;
4545
}
4646

47-
public static T MergedResources<T>(this T self, params ResourceDictionary[] resources) where T : Microsoft.Maui.Controls.ResourceDictionary
47+
public static T MergedDictionaries<T>(this T self, params ResourceDictionary[] resources) where T : Microsoft.Maui.Controls.ResourceDictionary
4848
{
4949
foreach (var resource in resources)
5050
{
@@ -53,7 +53,7 @@ public static T MergedResources<T>(this T self, params ResourceDictionary[] reso
5353
return self;
5454
}
5555

56-
public static T MergedResources<T>(this T self, IList<ResourceDictionary> resources) where T : Microsoft.Maui.Controls.ResourceDictionary
56+
public static T MergedDictionaries<T>(this T self, IList<ResourceDictionary> resources) where T : Microsoft.Maui.Controls.ResourceDictionary
5757
{
5858
foreach (var resource in resources)
5959
{

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</Version>
14+
<Version>8.8.6</Version>
1515
<Authors>FmgYazılım</Authors>
1616
<Company>Fmg Yazılım</Company>
1717
<Copyright>©2024</Copyright>

templates/FmgLib.MauiMarkup.TemplateApp/FmgLib.MauiMarkup.Template.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- The package metadata. Fill in the properties marked as TODO below -->
55
<!-- Follow the instructions on https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices -->
66
<PackageId>FmgLib.MauiMarkup.Template</PackageId>
7-
<PackageVersion>3.3.2</PackageVersion>
7+
<PackageVersion>3.3.2.1</PackageVersion>
88
<Title>FmgLib.MauiMarkup.Template</Title>
99
<Authors>FmgYazılım</Authors>
1010
<Description>C# Markup (No XAML) templates for .NET MAUI application with Hotreload process.</Description>

templates/FmgLib.MauiMarkup.TemplateApp/content/FmgLib.MauiMarkup.App/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public partial class App : Application
55
public App()
66
{
77
this
8-
.Resources(new ResourceDictionary().MergedResources(AppStyles.Default))
8+
.Resources(new ResourceDictionary().MergedDictionaries(AppStyles.Default))
99
.MainPage(new AppShell());
1010
}
1111
}

0 commit comments

Comments
 (0)