Windows 8 MVVM Patterns Revealed by Ashish Ghoda

Windows 8 MVVM Patterns Revealed by Ashish Ghoda

Author:Ashish Ghoda
Language: eng
Format: mobi, epub
ISBN: 9781430249085
Publisher: Apress
Published: 0101-01-01T00:00:00+00:00


The first delegate is called when ICommand.Execute(Object param) is invoked.

The second delegate evaluates the state of the command when ICommand.CanExecute(Object param) is called.

You also have to implement a method, in our case named RaiseCanExecuteChanged(), which triggers the CanExecuteChanged event. This causes the UI element to reevaluate the CanExecute() of the command.

The following code snippet demonstrates the above-mentioned implementation of the DelegateCommand class:

public class DelegateCommand : ICommand

{

private readonly Action<object> _execute;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.