aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/ListBox.cs
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-08-11 04:20:36 +0200
committerGitHub <noreply@github.com>2016-08-11 04:20:36 +0200
commit81eb8c7a75ffbe8b6740b2a84a9ebff75da9b393 (patch)
tree3225277358a2bba61c4496923ba39353c942098b /src/GraphicObjects/ListBox.cs
parent4d4a9116ea5c68b27f0b7c43db9682ab57738ae7 (diff)
parent7560c0bb4a769210e289e2633ddf13d2617f8e6e (diff)
Merge pull request #18 from jpbruyere/BindingImprovement
Instantiator
Diffstat (limited to 'src/GraphicObjects/ListBox.cs')
-rw-r--r--src/GraphicObjects/ListBox.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs
index 58d41e0b..ab349ed4 100644
--- a/src/GraphicObjects/ListBox.cs
+++ b/src/GraphicObjects/ListBox.cs
@@ -119,7 +119,7 @@ namespace Crow
if (ItemTemplates == null)
ItemTemplates = new Dictionary<string, ItemTemplate> ();
if (!ItemTemplates.ContainsKey ("default"))
- ItemTemplates["default"] = new ItemTemplate (ItemTemplate);
+ ItemTemplates ["default"] = Interface.GetItemTemplate (ItemTemplate);
for (int i = 1; i <= (data.Count / itemPerPage) + 1; i++) {
if (cancelLoading)
@@ -164,16 +164,16 @@ namespace Crow
return;
GraphicObject g = null;
- ItemTemplate itemStream = null;
+ ItemTemplate iTemp = null;
Type dataType = data [i].GetType ();
if (ItemTemplates.ContainsKey (dataType.FullName))
- itemStream = ItemTemplates [dataType.FullName];
+ iTemp = ItemTemplates [dataType.FullName];
else
- itemStream = ItemTemplates ["default"];
+ iTemp = ItemTemplates ["default"];
lock (Interface.CurrentInterface.LayoutMutex) {
- g = itemStream.Instance;
+ g = iTemp.CreateInstance();
page.AddChild (g);
g.DataSource = data [i];
}
@@ -190,8 +190,8 @@ namespace Crow
}else
g.MouseClick += itemClick;
- if (itemStream.Expand != null && g is Expandable) {
- (g as Expandable).Expand += itemStream.Expand;
+ if (iTemp.Expand != null && g is Expandable) {
+ (g as Expandable).Expand += iTemp.Expand;
}
//g.LogicalParent = this;
}