Skip to content

Commit a32bb9e

Browse files
committed
Removed UpdateAccentCommand from AccentAnalyzer
1 parent 7b059c1 commit a32bb9e

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

components/ColorAnalyzer/samples/AccentAnalyzerSample.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
1+
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
22
<Page x:Class="ColorAnalyzerExperiment.Samples.AccentAnalyzerSample"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -29,7 +29,7 @@
2929
Stretch="Uniform">
3030
<interactivity:Interaction.Behaviors>
3131
<interactivity:EventTriggerBehavior EventName="ImageOpened">
32-
<interactivity:InvokeCommandAction Command="{x:Bind AccentAnalyzer.AccentUpdateCommand}" />
32+
<interactivity:CallMethodAction MethodName="UpdateAccent" TargetObject="{x:Bind AccentAnalyzer}"/>
3333
</interactivity:EventTriggerBehavior>
3434
</interactivity:Interaction.Behaviors>
3535
</Image>

components/ColorAnalyzer/src/AccentAnalyzer.Properties.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ public float Colorfulness
146146
/// </summary>
147147
public IReadOnlyList<AccentColorInfo>? AccentColors { get; private set; }
148148

149-
/// <summary>
150-
/// Gets a command that executes an accent update.
151-
/// </summary>
152-
public ICommand AccentUpdateCommand { get; }
153-
154149
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
155150
{
156151
if (d is not AccentAnalyzer analyzer)

components/ColorAnalyzer/src/AccentAnalyzer.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,11 @@ namespace CommunityToolkit.WinUI.Helpers;
2121
/// </summary>
2222
public partial class AccentAnalyzer : DependencyObject
2323
{
24-
private partial class Command(Action action) : ICommand
25-
{
26-
// This is ridiculous, but the event must be here since it's part of the ICommand interface,
27-
// however without supression it causes an error that prevents the CI from building.
28-
#pragma warning disable CS0067
29-
30-
/// <inheritdoc/>
31-
public event EventHandler? CanExecuteChanged;
32-
33-
#pragma warning restore CS0067
34-
35-
/// <inheritdoc/>
36-
public bool CanExecute(object? parameter) => true;
37-
38-
/// <inheritdoc/>
39-
public void Execute(object? parameter)
40-
{
41-
action();
42-
}
43-
}
44-
4524
/// <summary>
4625
/// Initialize an instance of the <see cref="AccentAnalyzer"/> class.
4726
/// </summary>
4827
public AccentAnalyzer()
4928
{
50-
AccentUpdateCommand = new Command(UpdateAccent);
5129
}
5230

5331
/// <summary>

0 commit comments

Comments
 (0)