diff options
| author | jp <jp_bruyere@hotmail.com> | 2016-04-01 09:33:01 +0200 |
|---|---|---|
| committer | jp <jp_bruyere@hotmail.com> | 2016-04-01 09:33:01 +0200 |
| commit | a2151156e8e5aa7deb5cc5e7eb5d6f416599217e (patch) | |
| tree | 78dc68b199d34d966f39f1685b808e98d438f06d /src/GraphicObjects/Window.cs | |
| parent | 22644afe6f0722dcfb5fd27ba353f12274f55eb6 (diff) | |
several changes to merge later
Diffstat (limited to 'src/GraphicObjects/Window.cs')
| -rw-r--r-- | src/GraphicObjects/Window.cs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 429d4269..94fe40d3 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -28,21 +28,14 @@ namespace Crow Container _contentContainer; Direction currentDirection = Direction.None; + public event EventHandler Closing; + #region CTOR public Window () : base() { } #endregion - #region GraphicObject overrides - [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true - public override bool Focusable - { - get { return base.Focusable; } - set { base.Focusable = value; } - } - #endregion - public override GraphicObject Content { get { return _contentContainer == null ? null : _contentContainer.Child; @@ -221,10 +214,13 @@ namespace Crow protected void butQuitPress (object sender, MouseButtonEventArgs e) { - ILayoutable parent = (sender as GraphicObject).Parent; - while(!(parent is Window)) - parent = parent.Parent; - Interface.CurrentInterface.DeleteWidget (parent as GraphicObject); + close (); + } + + void close(){ + Closing.Raise (this, null); + + Interface.CurrentInterface.DeleteWidget (this); } public override void ResolveBindings () |