diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-27 00:21:48 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-27 00:21:48 +0100 |
| commit | 8a25a19ee73e8b7c0c9726bbb2ce4ec918f4e905 (patch) | |
| tree | 8098ec3d8137c0dcc569db78fbdb4d6921187e28 /src/Command.cs | |
| parent | a519d07929a490ac9bfade86355865744787f311 (diff) | |
icon menuitem, PopWidth and PopHeight, commands
Diffstat (limited to 'src/Command.cs')
| -rw-r--r-- | src/Command.cs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/Command.cs b/src/Command.cs index 35a7facc..f7a12465 100644 --- a/src/Command.cs +++ b/src/Command.cs @@ -35,16 +35,20 @@ namespace Crow #endregion #region CTOR - public Command () + public Command (Action _executeAction) { + execute = _executeAction; } #endregion + Action execute; + string caption; + Picture icon; bool isEnabled; - - [XmlAttributeAttribute()][DefaultValue(true)] + #region Public properties + [XmlAttributeAttribute][DefaultValue(true)] public virtual bool IsEnabled { get { return isEnabled; } set { @@ -54,7 +58,7 @@ namespace Crow NotifyValueChanged ("IsEnabled", isEnabled); } } - [XmlAttributeAttribute()][DefaultValue("Unamed Command")] + [XmlAttributeAttribute][DefaultValue("Unamed Command")] public virtual string Caption { get { return caption; } set { @@ -65,5 +69,27 @@ namespace Crow } } + [XmlAttributeAttribute] + public Picture Icon { + get { return icon; } + set { + if (icon == value) + return; + icon = value; + NotifyValueChanged ("Icon", icon); + } + } + #endregion + + public void Execute(){ + if (execute != null) + execute (); + } + internal void raiseAllValuesChanged(){ + NotifyValueChanged ("IsEnabled", isEnabled); + NotifyValueChanged ("Icon", icon); + NotifyValueChanged ("Caption", caption); + } + } } |