diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-08-21 16:13:12 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-08-21 16:13:12 +0200 |
| commit | 4464d8c4d183a963a0c39f5eea393529ebbbc013 (patch) | |
| tree | 230b8cf4bf05c13054c1bc25406defbffb4c76e6 /src/GraphicObjects/ListBox.cs | |
| parent | 4c45c1aba33ea287650bef43543af559b8804fae (diff) | |
Item template property for listbox, added ItemTemplate for testTypeViewer
Diffstat (limited to 'src/GraphicObjects/ListBox.cs')
| -rw-r--r-- | src/GraphicObjects/ListBox.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs index a66fe7d4..117dd626 100644 --- a/src/GraphicObjects/ListBox.cs +++ b/src/GraphicObjects/ListBox.cs @@ -26,6 +26,7 @@ using System.ComponentModel; namespace go { [DefaultTemplate("#go.Templates.Listbox.goml")] + //[DefaultTemplate("#go.Templates.ItemTemplate.goml")] public class ListBox : TemplatedControl { Group _list; @@ -44,13 +45,19 @@ namespace go ICollection data; int _selectedIndex; + string _itemTemplate; + [XmlAttributeAttribute][DefaultValue("#go.Templates.ItemTemplate.goml")] + public string ItemTemplate { + get { return _itemTemplate; } + set { _itemTemplate = value; } + } public int SelectedIndex{ get { return _selectedIndex; } set { _selectedIndex = value; } } - [XmlAttributeAttribute()][DefaultValue(null)] + [XmlAttributeAttribute][DefaultValue(null)] public ICollection Data { get { return data; @@ -62,7 +69,8 @@ namespace go if (data == null) return; foreach (var item in data) { - GraphicObject g = Interface.Load ("#go.Templates.ItemTemplate.goml", item); + GraphicObject g = Interface.Load (ItemTemplate, item); + //GraphicObject g = Interface.Load ("#go.Templates.Listbox.goml", item); // g.Tag = item; // g.MouseClick += (object sender, OpenTK.Input.MouseButtonEventArgs e) => { // |