Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

RelayCommand

public class RelayCommand : ICommand
{
    private Action<object> execute;
    private Func<object, bool> canExecute;

    public event EventHandler CanExecuteChanged
    {
        add { CommandManager.RequerySuggested += value; }
        remove { CommandManager.RequerySuggested -= value; }
    }

    public RelayCommand(Action<object> execute, Func<object, bool> canExecute)
    {
        this.execute = execute;
        this.canExecute = canExecute;
    }

    public bool CanExecute(object parameter)
    {
        return this.canExecute == null || this.canExecute(parameter);
    }

    public void Execute(object parameter)
    {
        this.execute(parameter);
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: NameValueCollection 
Csharp :: lcm of numbers 
Csharp :: datetime default c# 
Csharp :: checking if character is a digit or not in c# 
Csharp :: vector3 unity 
Csharp :: char to digit in java 
Csharp :: how to make a character run in unity 
Csharp :: nunjucks index in loop 
Csharp :: add a dictionary to another dictionary c# 
Csharp :: c# bubble sort 
Csharp :: file to byte array 
Csharp :: else if c# 
Csharp :: how to show an arrya in c# 
Csharp :: c# enum 
Csharp :: unity notification 
Csharp :: c# generate guid from hash 
Csharp :: verify if number c# 
Csharp :: how to define a function in c# 
Csharp :: Edit file C# 
Csharp :: c# list.foreach 
Csharp :: c# create excel file 
Csharp :: c# implement ienumerable t 
Csharp :: how to get rid of the slashes in datetime variables c# 
Csharp :: web page search c# 
Csharp :: authentication and authorization in asp.net c# with example 
Csharp :: take space separated input in c# 
Csharp :: get int value from enum c# 
Csharp :: get connection string from web.config in c# 
Csharp :: c# get date without time 
Csharp :: c# write iformfile 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =