diff --git a/src/CommunityToolkit.Maui.Markup.Benchmarks/BaseTest.cs b/src/CommunityToolkit.Maui.Markup.Benchmarks/BaseTest.cs index 0f647147..97d2df77 100644 --- a/src/CommunityToolkit.Maui.Markup.Benchmarks/BaseTest.cs +++ b/src/CommunityToolkit.Maui.Markup.Benchmarks/BaseTest.cs @@ -46,7 +46,7 @@ static void CreateAndSetMockApplication(out IServiceProvider serviceProvider) .UseMauiApp(); appBuilder.Services.AddSingleton(_ => new MockDispatcherProvider().GetForCurrentThread()); - + var mauiApp = appBuilder.Build(); var application = mauiApp.Services.GetRequiredService(); diff --git a/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/ExecuteBindingsBase.cs b/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/ExecuteBindingsBase.cs index 079e98cc..27236c09 100644 --- a/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/ExecuteBindingsBase.cs +++ b/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/ExecuteBindingsBase.cs @@ -5,7 +5,7 @@ namespace CommunityToolkit.Maui.Markup.Benchmarks; public abstract class ExecuteBindingsBase : BaseTest { protected const string helloWorldText = "Hello World"; - + protected ExecuteBindingsBase() { DefaultBindingsLabel = new() @@ -17,16 +17,16 @@ protected ExecuteBindingsBase() DefaultBindingsLabel.EnableAnimations(); DefaultMarkupBindingsLabel = new Label - { - BindingContext = DefaultMarkupBindingsLabelViewModel - }.Bind(Label.TextProperty, nameof(LabelViewModel.Text), mode: BindingMode.TwoWay) + { + BindingContext = DefaultMarkupBindingsLabelViewModel + }.Bind(Label.TextProperty, nameof(LabelViewModel.Text), mode: BindingMode.TwoWay) .Bind(Label.TextColorProperty, nameof(LabelViewModel.TextColor), mode: BindingMode.TwoWay); DefaultMarkupBindingsLabel.EnableAnimations(); TypedMarkupBindingsLabel = new Label - { - BindingContext = TypedMarkupBindingsLabelViewModel - }.Bind(Label.TextProperty, + { + BindingContext = TypedMarkupBindingsLabelViewModel + }.Bind(Label.TextProperty, getter: (LabelViewModel vm) => vm.Text, setter: (LabelViewModel vm, string text) => vm.Text = text, mode: BindingMode.TwoWay) @@ -36,12 +36,12 @@ protected ExecuteBindingsBase() mode: BindingMode.TwoWay); TypedMarkupBindingsLabel.EnableAnimations(); } - + protected LabelViewModel DefaultBindingsLabelViewModel { get; } = new(); protected LabelViewModel DefaultMarkupBindingsLabelViewModel { get; } = new(); protected LabelViewModel TypedMarkupBindingsLabelViewModel { get; } = new(); - + protected Label DefaultBindingsLabel { get; } - protected Label DefaultMarkupBindingsLabel{ get; } - protected Label TypedMarkupBindingsLabel{ get; } + protected Label DefaultMarkupBindingsLabel { get; } + protected Label TypedMarkupBindingsLabel { get; } } \ No newline at end of file diff --git a/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/InitializeBindings.cs b/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/InitializeBindings.cs index dc83d9ec..09128a29 100644 --- a/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/InitializeBindings.cs +++ b/src/CommunityToolkit.Maui.Markup.Benchmarks/Benchmarks/InitializeBindings.cs @@ -9,12 +9,12 @@ public class InitializeBindings : BaseTest { BindingContext = new LabelViewModel() }; - + readonly Label defaultMarkupBindingsLabel = new() { BindingContext = new LabelViewModel() }; - + readonly Label typedMarkupBindingsLabel = new() { BindingContext = new LabelViewModel() @@ -26,7 +26,7 @@ public void InitializeDefaultBindings() defaultBindingsLabel.SetBinding(Label.TextProperty, nameof(LabelViewModel.Text), mode: BindingMode.TwoWay); defaultBindingsLabel.SetBinding(Label.TextColorProperty, nameof(LabelViewModel.TextColor), mode: BindingMode.TwoWay); } - + [Benchmark] public void InitializeDefaultBindingsMarkup() { @@ -34,7 +34,7 @@ public void InitializeDefaultBindingsMarkup() .Bind(Label.TextProperty, nameof(LabelViewModel.Text), mode: BindingMode.TwoWay) .Bind(Label.TextColorProperty, nameof(LabelViewModel.TextColor), mode: BindingMode.TwoWay); } - + [Benchmark] public void InitializeTypedBindingsMarkup() { diff --git a/src/CommunityToolkit.Maui.Markup.Benchmarks/Extensions/AnimationExtensions.cs b/src/CommunityToolkit.Maui.Markup.Benchmarks/Extensions/AnimationExtensions.cs index 98b53db8..55b8d873 100644 --- a/src/CommunityToolkit.Maui.Markup.Benchmarks/Extensions/AnimationExtensions.cs +++ b/src/CommunityToolkit.Maui.Markup.Benchmarks/Extensions/AnimationExtensions.cs @@ -45,7 +45,7 @@ public object GetService(Type serviceType) { return AnimationManager; } - + if (serviceType == typeof(IDispatcher)) { return new MockDispatcherProvider().GetForCurrentThread(); diff --git a/src/CommunityToolkit.Maui.Markup.Benchmarks/Program.cs b/src/CommunityToolkit.Maui.Markup.Benchmarks/Program.cs index 58bfa84d..b5107b25 100644 --- a/src/CommunityToolkit.Maui.Markup.Benchmarks/Program.cs +++ b/src/CommunityToolkit.Maui.Markup.Benchmarks/Program.cs @@ -8,7 +8,7 @@ public class Program public static void Main(string[] args) { var config = DefaultConfig.Instance; - + BenchmarkRunner.Run(config, args); BenchmarkRunner.Run(config, args); BenchmarkRunner.Run(config, args);