<?xml version="1.0"?>
<Popper Caption="{./Caption}" Background="{./Background}" PopDirection="{./Orientation}"
- Foreground = "{./Foreground}" CanPop="{./HasChildren}"
+ Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
Unpop = "{Foreground=LightGray;Background=Transparent}">
<Template>
<Label Text="{./Caption}"
string test = e.Time.ToString ();
NotifyValueChanged ("PropertyLessBinding", test);
}
+ void onNew(object sender, EventArgs e){
+ Debug.WriteLine ("menu new clicked");
+ }
}
}
<?xml version="1.0"?>
<Menu>
<MenuItem Caption="File">
- <MenuItem Caption="New"/>
+ <MenuItem Caption="New" Execute="onNew"/>
<MenuItem Caption="Open"/>
<MenuItem Caption="Save"/>
<MenuItem Caption="Quit"/>
public MenuItem () : base() {}
#endregion
-// public event EventHandler Pop;
-// public event EventHandler Unpop;
+ public event EventHandler Execute;
string caption;
- Command command;
+ Command command;//TODO
[XmlAttributeAttribute()][DefaultValue(null)]
public virtual Command Command {
base.AddItem (g);
g.NotifyValueChanged ("Orientation", Alignment.Right);
}
+
+ void onMI_Click (object sender, MouseButtonEventArgs e)
+ {
+ Execute.Raise (this, null);
+ }
}
}
+