Catel.Examples.WPF.PersonApplication.ViewModels.PersonViewModel.OnGenerateDataCanExecute C# (CSharp) Method

OnGenerateDataCanExecute() private method

Method to check whether the GenerateData command can be executed.
private OnGenerateDataCanExecute ( object parameter ) : bool
parameter object The parameter of the command.
return bool
        private bool OnGenerateDataCanExecute(object parameter)
        {
            // Note: normally you wouldn't use the ExposeAttribute if you need to access
            // the properties, but this is to show that all existing features (such as
            // INotifyPropertyChanged, IDataErrorInfo, etc also work with the ExposeAttribute).

            if (!string.IsNullOrEmpty(GetValue<string>("FirstName")))
            {
                return false;
            }

            if (!string.IsNullOrEmpty(GetValue<string>("MiddleName")))
            {
                return false;
            }

            if (!string.IsNullOrEmpty(this.LastName))
            {
                return false;
            }

            return true;
        }