aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/TemplatedControl.cs
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-09-06 16:52:57 +0200
committerGitHub <noreply@github.com>2016-09-06 16:52:57 +0200
commit348f7e0ba05fb95472d85a42ab09fc5de85176ff (patch)
treee09ba9e5123d9775f7e8bed6a3ac13c72444be6e /src/GraphicObjects/TemplatedControl.cs
parent6c2ececc6442b26f6788229d09bba83b919c099c (diff)
parent801c274f1d022f658176deefe2a6bc9e2c398613 (diff)
Merge pull request #30 from jpbruyere/TreeViewItemAsTemplatedGroup
Tree view and list as templated group, templatedGroup will hold data handling
Diffstat (limited to 'src/GraphicObjects/TemplatedControl.cs')
-rw-r--r--src/GraphicObjects/TemplatedControl.cs36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index cb14dfd9..7f2e1b87 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -46,9 +46,6 @@ namespace Crow
}
string _template;
- string _itemTemplate;
- public Dictionary<string, ItemTemplate> ItemTemplates = new Dictionary<string, Crow.ItemTemplate>();//TODO: dont instantiate if not used
- //but then i should test if null in msil gen
[XmlAttributeAttribute][DefaultValue(null)]
public string Template {
get { return _template; }
@@ -63,19 +60,7 @@ namespace Crow
loadTemplate (CurrentInterface.Load (_template));
}
}
- [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ItemTemplate.goml")]
- public string ItemTemplate {
- get { return _itemTemplate; }
- set {
- if (value == _itemTemplate)
- return;
- _itemTemplate = value;
-
- //TODO:reload list with new template?
- NotifyValueChanged("ItemTemplate", _itemTemplate);
- }
- }
#region GraphicObject overrides
public override GraphicObject FindByName (string nameToFind)
{
@@ -86,7 +71,7 @@ namespace Crow
{
//onDraw is overrided to prevent default drawing of background, template top container
//may have a binding to root background or a fixed one.
- //this allow applying root background to random template component
+ //this allow applying root background to random template's component
gr.Save ();
if (ClipToClientRect) {
@@ -113,6 +98,7 @@ namespace Crow
this.ResolveBindings ();
}
+ //TODO:IXmlSerializable is not used anymore
#region IXmlSerializable
public override System.Xml.Schema.XmlSchema GetSchema(){ return null; }
public override void ReadXml(System.Xml.XmlReader reader)
@@ -151,15 +137,15 @@ namespace Crow
xr.MoveToElement ();
itemTmp = xr.ReadInnerXml ();
- if (ItemTemplates == null)
- ItemTemplates = new Dictionary<string, ItemTemplate> ();
-
- using (IMLReader iTmp = new IMLReader (null, itemTmp)) {
- ItemTemplates [dataType] =
- new ItemTemplate (iTmp.RootType, iTmp.GetLoader (), dataType, datas);
- }
- if (!string.IsNullOrEmpty (datas))
- ItemTemplates [dataType].CreateExpandDelegate(this);
+// if (ItemTemplates == null)
+// ItemTemplates = new Dictionary<string, ItemTemplate> ();
+//
+// using (IMLReader iTmp = new IMLReader (null, itemTmp)) {
+// ItemTemplates [dataType] =
+// new ItemTemplate (iTmp.RootType, iTmp.GetLoader (), dataType, datas);
+// }
+// if (!string.IsNullOrEmpty (datas))
+// ItemTemplates [dataType].CreateExpandDelegate(this);
continue;
}