diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-14 23:16:33 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-14 23:16:33 +0200 |
| commit | 3e4b4ebad1e7b2d81d35da5f75198edd61ea10b9 (patch) | |
| tree | d54e29e9e53e2e6d8f221a1bac8e0789e5214200 /src | |
| parent | b2bef2567b1fa60ec7f9f91ab475fd0e02dbc834 (diff) | |
make use of binding for default window
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/Window.cs | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 8355ff15..18ea1fd4 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -9,10 +9,19 @@ namespace go [DefaultTemplate("#go.Templates.Window.goml")] public class Window : TemplatedContainer { - Label _title; - Image _icon; + string _title; + string _icon; Container _contentContainer; + #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; @@ -23,13 +32,21 @@ namespace go } [XmlAttributeAttribute()][DefaultValue("Window")] public string Title { - get { return _title.Text; } + get { return _title; } set { - if (_title == null) - return; - _title.Text = value; + _title = value; + NotifyValueChanged ("Title", _title); } - } + } + [XmlAttributeAttribute()][DefaultValue("#go.Images.Icons.tetra.png")] + public string Icon { + get { return _icon; } + set { + _icon = value; + NotifyValueChanged ("Icon", _icon); + } + } + public Window () : base() { } @@ -170,8 +187,6 @@ namespace go { base.loadTemplate (template); _contentContainer = this.child.FindByName ("Content") as Container; - _title = this.child.FindByName ("Title") as Label; - _icon = this.child.FindByName ("Icon") as Image; } protected void butQuitPress (object sender, MouseButtonEventArgs e) |