// 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.
// This file is inspired from the MvvmLight library (lbugnion/MvvmLight),
// more info in ThirdPartyNotices.txt in the root of the project.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace CommunityToolkit.Mvvm.Input;
///
/// A command whose sole purpose is to relay its functionality to other
/// objects by invoking delegates. The default return value for the
/// method is . This type does not allow you to accept command parameters
/// in the and callback methods.
///
public sealed partial class RelayCommand : IRelayCommand
{
///
/// The to invoke when is used.
///
private readonly Action execute;
[AllowNull]
private readonly Action