diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-03 15:11:24 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-03 15:11:24 +0200 |
| commit | ef87679b886e5ce8b4defc21e3b9eac6c5030663 (patch) | |
| tree | 2d24b86532183fcdcd9ac71493973b6e50d3110a /src/GraphicObjects/ListBox.cs | |
| parent | c54c8b8e7e369dbba890efdb35a015740d1d95ea (diff) | |
- Item template
- Null binding for template items with "{}"
Diffstat (limited to 'src/GraphicObjects/ListBox.cs')
| -rw-r--r-- | src/GraphicObjects/ListBox.cs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs index 869eae2a..1f0ccf5e 100644 --- a/src/GraphicObjects/ListBox.cs +++ b/src/GraphicObjects/ListBox.cs @@ -41,22 +41,32 @@ namespace go } #endregion - IList data; + ICollection data; + int _selectedIndex; + + public int SelectedIndex{ + get { return _selectedIndex; } + set { _selectedIndex = value; } + } [XmlAttributeAttribute()][DefaultValue(null)] - public IList Data { + public ICollection Data { get { return data; } - set { - if (data == value) - return; - + set { data = value; - + _list.Children.Clear (); + if (data == null) + return; foreach (var item in data) { - _list.addChild(Interface.Load ("#go.Templates.ItemTemplate.goml", item)); + GraphicObject g = Interface.Load ("#go.Templates.ItemTemplate.goml", item); +// g.Tag = item; +// g.MouseClick += (object sender, OpenTK.Input.MouseButtonEventArgs e) => { +// +// }; + _list.addChild(g); } } |