diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-02-10 15:54:50 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-02-10 15:54:50 +0100 |
| commit | 456e7c847a4aa6fed44cc2d970ac9400ea54d0c4 (patch) | |
| tree | 42dc38f31028f3854f55a8203390ed922dd8cd5a /src/Command.cs | |
| parent | 5ca711641d1934adf08d2675641e3f61647f3ffc (diff) | |
TextBox, Label, simpler SVG icon for file sys viewers (improve speed a lot), divers debug and code clean
Diffstat (limited to 'src/Command.cs')
| -rw-r--r-- | src/Command.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Command.cs b/src/Command.cs index f7a12465..1f744f84 100644 --- a/src/Command.cs +++ b/src/Command.cs @@ -45,17 +45,17 @@ namespace Crow string caption; Picture icon; - bool isEnabled; + bool canExecute = true; #region Public properties [XmlAttributeAttribute][DefaultValue(true)] - public virtual bool IsEnabled { - get { return isEnabled; } + public virtual bool CanExecute { + get { return canExecute; } set { - if (isEnabled == value) + if (canExecute == value) return; - isEnabled = value; - NotifyValueChanged ("IsEnabled", isEnabled); + canExecute = value; + NotifyValueChanged ("CanExecute", canExecute); } } [XmlAttributeAttribute][DefaultValue("Unamed Command")] @@ -82,11 +82,11 @@ namespace Crow #endregion public void Execute(){ - if (execute != null) + if (execute != null && CanExecute) execute (); } internal void raiseAllValuesChanged(){ - NotifyValueChanged ("IsEnabled", isEnabled); + NotifyValueChanged ("CanExecute", canExecute); NotifyValueChanged ("Icon", icon); NotifyValueChanged ("Caption", caption); } |