<?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+ <Label Text="{../../Caption}" Height="80" Width="200"/>\r
+</HorizontalStack>-->\r
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+ <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>\r
-<Border CornerRadius="0" BorderColor="LightGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <HorizontalStack Margin="1" Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <Label Margin="1" Foreground="Black" Background="White" Text="{Text}" \r
- Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<Border CornerRadius="0" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+ <HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+ <Label Margin="1" Foreground="Black" Background="White" Text="{../../../Text}" \r
+ Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
<Button Width="14" Height="14" >\r
<Image Margin="0" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
</Button>\r
<?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true"\r
- Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+ <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
</Scroller>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}" \r
- MouseClick="onMouseClick">\r
- <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <HorizontalStack Spacing="1" Height="-1" Width="{TemplatedWidth}">\r
- <Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Title}" Width="{TemplatedWidth}"/>\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" \r
+ MouseClick="../onMouseClick">\r
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">\r
+ <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>\r
+ <Label Text="{../../../../Title}" Width="{../../../../TemplatedWidth}"/>\r
</HorizontalStack>\r
- <Container Name="Content" Visible="false" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+ <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>
-<Group Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+<Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
<Border CornerRadius="5" BorderWidth="1" Margin="6"
- Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
<Container Name="Content" Margin="10"
- Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>
+ Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
</Border>
- <Label Text="{Title}" VerticalAlignment="Top" Left="15"
+ <Label Text="{../../Title}" VerticalAlignment="Top" Left="15"
Background="Clear" Margin="1"/>
</Group>
\ No newline at end of file
<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
<VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
</Border>-->\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true"\r
- Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+ <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
</Scroller>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>
-<Border Height="{TemplatedHeight}" Width="{TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
- <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
- <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1"
+<Border Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
+ <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1"
Background="0,1;0,5;1,0;0,5">
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >
<GraphicObject Width="5" Height="5"/>
- <Image Margin="1" Width="12" Height="12" Path="{Icon}"/>
- <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />
+ <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
+ <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
<Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"
MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"
- MouseClick="butQuitPress"/>
+ MouseClick="../../../../../../butQuitPress"/>
</Border>
<GraphicObject Width="5" Height="5"/>
</HorizontalStack>
</Border>
- <HorizontalStack Spacing="10" Margin="10" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+ <HorizontalStack Spacing="10" Margin="10" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}">
<Image Name="Image" Width="32" Height="32"
Path="#go.Images.Icons.iconInfo.svg" />
- <TextRun Font="serif, 12" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Text="{Message}"
+ <TextRun Font="serif, 12" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Text="{../../../../Message}"
Multiline="true" WordWrap="true"/>
</HorizontalStack>
- <HorizontalStack Height="-1" Width="{TemplatedWidth}" Margin="5">
+ <HorizontalStack Height="-1" Width="{../../../TemplatedWidth}" Margin="5">
<GraphicObject Height="5"/>
<Button Text="Ok"/>
<Button Text="Cancel"/>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{TemplatedWidth}" MouseClick="onMouseClick">\r
- <HorizontalStack Spacing="1" Height="-1" Width="{TemplatedWidth}">\r
- <Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Title}" Width="{TemplatedWidth}"/>\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">\r
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../TemplatedWidth}">\r
+ <Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>\r
+ <Label Text="{../../../Title}" Width="{../../../TemplatedWidth}"/>\r
</HorizontalStack>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+ <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>\r
<Border BorderWidth="1" BorderColor="LightGray">\r
- <GenericStack Orientation="{Orientation}" Width="0" Height="0">\r
- <Button Width="12" Height="12" MouseClick="onScrollBack">\r
- <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>\r
+ <GenericStack Orientation="{../../Orientation}" Width="0" Height="0">\r
+ <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
+ <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="../../../../up"/>\r
</Button>\r
- <Slider Name="Slider" Value="{Scroll}" Maximum="{MaximumScroll}" \r
- Width="{Width}" Height="{Height}" Orientation="{Orientation}"\r
- ValueChanged="onSliderValueChange"/>\r
- <Button Width="12" Height="12" MouseClick="onScrollForth">\r
- <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
+ <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
+ Width="{../../../Width}" Height="{../../../Height}" Orientation="{../../../Orientation}"\r
+ ValueChanged="../../../onSliderValueChange"/>\r
+ <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
+ <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="../../../../down"/>\r
</Button>\r
</GenericStack>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>
-<Border BorderWidth="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="White">
- <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
- <Label Foreground="DimGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}"
- Text="{Value}" Margin="1" TextAlignment="RightCenter"/>
- <VerticalStack Width="-1" Height="{TemplatedHeight}" Spacing="1" >
- <Button Width="12" Height="8" MouseClick="onUp">
+<Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="White">
+ <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <Label Foreground="DimGray" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"
+ Text="{../../../Value}" Margin="1" TextAlignment="RightCenter"/>
+ <VerticalStack Width="-1" Height="{../../../TemplatedHeight}" Spacing="1" >
+ <Button Width="12" Height="8" MouseClick="../../../../onUp">
<Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>
</Button>
- <Button Width="12" Height="8" MouseClick="onDown">
+ <Button Width="12" Height="8" MouseClick="../../../../onDown">
<Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>
</Button>
</VerticalStack>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
- <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1" \r
+<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+ <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" \r
Background="0,1;0,5;1,0;0,5">\r
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >\r
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >\r
<GraphicObject Width="5"/>\r
- <Image Margin="1" Width="12" Height="12" Path="{Icon}"/>\r
- <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />\r
+ <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>\r
+ <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />\r
<Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"\r
MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
- MouseClick="butQuitPress"/>\r
+ MouseClick="../../../../../../butQuitPress"/>\r
</Border>\r
<GraphicObject Width="5"/>\r
</HorizontalStack>\r
</Border>\r
- <Container Name="Content" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
+ <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
int frameCpt = 0;\r
int idx = 0;\r
string[] testFiles = {\r
+ "test_Listbox.goml",\r
+ "testCombobox.goml",\r
"fps.goml",\r
"testCheckbox.goml",\r
"testExpandable.goml",\r
"testMsgBox.goml",\r
"testGrid.goml",\r
"testMeter.goml",\r
-// "testCombobox.goml",\r
// "test4.goml",\r
};\r
\r
base.OnLoad (e);\r
//this.AddWidget(new test4());\r
\r
- LoadInterface("Interfaces/" + testFiles[idx]);\r
+ GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
+ obj.DataSource = this;\r
}\r
protected override void OnUpdateFrame (FrameEventArgs e)\r
{\r
if (idx == testFiles.Length)\r
idx = 0;\r
this.Title = testFiles [idx];\r
- LoadInterface("Interfaces/" + testFiles[idx]);\r
+ GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
+ obj.DataSource = this;\r
\r
}\r
\r
<?xml version="1.0"?>\r
-<Checkbox Width="100" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
+<Checkbox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="false"/>\r
\r
<Checkbox Name="chk2" IsChecked="true"/>\r
<Checkbox Name="chk3"/>\r
<Checkbox Name="chk4"/>\r
+ <HorizontalStack Fit="true" Margin="20">\r
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+ </HorizontalStack>\r
</VerticalStack>\r
</Expandable>\r
<Checkbox Name="chk2" IsChecked="true"/>\r
<Checkbox Name="chk3"/>\r
<Checkbox Name="chk4"/>\r
+ <HorizontalStack Fit="true" Margin="20">\r
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+ </HorizontalStack>\r
</VerticalStack> \r
</Border>\r
</Popper>\r
<?xml version="1.0"?>\r
<!--<ListBox Data="{TestList}" Focusable="true"/>-->\r
<ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"\r
- HorizontalAlignment="Left" Width="0" Height="0" Margin="50">\r
+ HorizontalAlignment="Left" Width="-1" Height="-1" Margin="50">\r
<!-- <Template>\r
<Border BorderWidth="1" Margin="1" MinimumSize="100;100" Width="0" Height="0" >\r
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true" \r
</Scroller>\r
</Border>\r
</Template>-->\r
- <Template>\r
+<!-- <Template>\r
<Border BorderWidth="1" Margin="1" MinimumSize="100;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true" \r
Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
<VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
</Scroller>\r
</Border>\r
- </Template>\r
+ </Template>-->\r
</ListBox>\r
\r
}
public bool FindMember(string _memberName)
{
+ if (Instance == null)
+ return false;
Type t = Instance.GetType ();
Member = t.GetMember (_memberName,BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).FirstOrDefault ();
//if binding exp = '{}' => binding is done on datasource
if (string.IsNullOrEmpty (Expression)) {
- Target = new MemberReference (Source.Instance);
+ Target = new MemberReference ((Source.Instance as GraphicObject).DataSource);
return true;
}
if (tmp == null)
return false;
if (bindingExp [ptr] == "..")
- tmp = tmp.Parent as GraphicObject;
+ tmp = tmp.Parent as ILayoutable;
else if (bindingExp [ptr] == ".") {
if (ptr > 0)
throw new Exception ("Syntax error in binding, './' may only appear in first position");
ptr++;
}
+ if (tmp == null)
+ return false;
+
string[] bindTrg = bindingExp [ptr].Split ('.');
if (bindTrg.Length == 1)
{\r
[DefaultTemplate("#go.Templates.Combobox.goml")]\r
[DefaultOverlayTemplate("#go.Templates.ComboboxOverlay.goml")]\r
- public class Combobox : TemplatedContainer\r
+ public class Combobox : TemplatedControl\r
{ \r
#region CTOR\r
public Combobox() : base(){ } \r
base.loadTemplate (template);\r
loadOverlayTemplate (null);\r
}\r
- public override GraphicObject Content {\r
- get {\r
- throw new NotImplementedException ();\r
- }\r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
+// public override GraphicObject Content {\r
+// get {\r
+// throw new NotImplementedException ();\r
+// }\r
+// set {\r
+// throw new NotImplementedException ();\r
+// }\r
+// }\r
#endregion\r
\r
protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)\r
{\r
if (overlayTemplate == null) {\r
DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();\r
- Overlay = Interface.Load (dt.Path, this, !Interface.DontResoveGOML);\r
+ Overlay = Interface.Load (dt.Path);\r
+ Overlay.ResolveBindings ();\r
} else\r
Overlay = overlayTemplate;\r
_list = Overlay.FindByName ("List") as Group;\r
lock (pendingChildrenAddition) {\r
if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)\r
return;\r
- while (pendingChildrenAddition.Count > 0)\r
+ while (pendingChildrenAddition.Count > 0) {\r
_list.addChild (pendingChildrenAddition.Dequeue ());\r
+ }\r
}\r
}\r
\r
\r
foreach (var item in data) {\r
ms.Seek(0,SeekOrigin.Begin);\r
- GraphicObject g = Interface.Load (ms, t, item);\r
+ GraphicObject g = Interface.Load (ms, t);\r
+ g.DataSource = item;\r
g.MouseClick += itemClick;\r
\r
lock (pendingChildrenAddition) {\r
base.ClearBinding ();\r
\r
}\r
+\r
}\r
}\r
IsExpanded = !IsExpanded;\r
base.onMouseClick (sender, e);\r
}\r
-\r
+ public override void ResolveBindings ()\r
+ {\r
+ base.ResolveBindings ();\r
+ if (Content != null)\r
+ Content.ResolveBindings ();\r
+ }\r
}\r
}\r
#endregion\r
\r
#region public fields\r
+ public GraphicObject LogicalParent;\r
public Rectangle Bounds;\r
public Rectangle Slot = new Rectangle ();\r
public object Tag;\r
#region ILayoutable\r
[XmlIgnore]public ILayoutable Parent { \r
get { return _parent; }\r
- set { _parent = value; }\r
+ set {\r
+// if (_parent == value)\r
+// return;\r
+// if (_parent != null)\r
+// ClearBinding ();\r
+// \r
+ _parent = value;\r
+//\r
+// if (DataSource != null)\r
+// ResolveBindings ();\r
+ }\r
}\r
+\r
+\r
[XmlIgnore]public virtual Rectangle ClientRectangle {\r
get {\r
Rectangle cb = Slot.Size;\r
}\r
object dataSource;\r
\r
- [XmlIgnore]public object DataSource {\r
+ [XmlIgnore]public virtual object DataSource {\r
set {\r
if (dataSource == value)\r
return;\r
}\r
get { \r
return dataSource == null ? \r
- Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null : dataSource;\r
+ LogicalParent == null ?\r
+ Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null : LogicalParent.DataSource : dataSource;\r
}\r
}\r
#endregion\r
{\r
List<Binding> resolved = new List<Binding> ();\r
foreach (Binding b in Bindings) {\r
+ if (!string.IsNullOrEmpty (b.DynMethodId))\r
+ continue;\r
if (b.Source.Member.MemberType == MemberTypes.Event) {\r
if (b.Expression.StartsWith("{")){\r
CompileEventSource(b);\r
\r
Type[] args = {typeof(object), typeof(object),handlerArgsType};\r
dm = new DynamicMethod(grouped[0].NewDynMethodId,\r
- typeof(void), \r
+ MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot,\r
+ CallingConventions.Standard,\r
+ typeof(void),\r
args,\r
- sourceType);\r
+ sourceType,true);\r
+\r
+\r
\r
\r
il = dm.GetILGenerator(256);\r
}else\r
throw new Exception ("unandled source member type for binding"); \r
}else if (string.IsNullOrEmpty(b.Expression))\r
- targetValue= grouped [0].Target;//empty binding exp=> bound to target object by default\r
+ targetValue= grouped [0].Target.Instance;//empty binding exp=> bound to target object by default\r
//TODO: handle other dest type conversions\r
if (b.Source.Property.PropertyType == typeof(string)){\r
if (targetValue == null){\r
if (b.Target.Member != null)\r
il.Emit (OpCodes.Ldstr, b.Target.Member.Name);\r
else\r
- il.Emit (OpCodes.Ldstr, b.Expression);\r
+ il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault());\r
il.Emit (OpCodes.Callvirt, stringEquals);\r
il.Emit (OpCodes.Brtrue, jumpTable[i]);\r
i++;\r
Thread t = new Thread (loadingThread);
t.Start ();
+ t.Join ();
}
}
-
+ public override void UpdateLayout (LayoutingType layoutType)
+ {
+ CheckPendingChildrenAddition ();
+ base.UpdateLayout (layoutType);
+ }
internal void CheckPendingChildrenAddition()
{
if (pendingChildrenAddition == null)
foreach (var item in data) {
ms.Seek(0,SeekOrigin.Begin);
- GraphicObject g = Interface.Load (ms, t, item);
+ GraphicObject g = Interface.Load (ms, t);
+ g.DataSource = item;
g.MouseClick += itemClick;
lock (pendingChildrenAddition) {
get { return _content; }\r
set { \r
if (_content != null) {\r
+ _content.LogicalParent = null;\r
_content.LayoutChanged -= _content_LayoutChanged;\r
_content.MouseLeave -= _content_MouseLeave;\r
}\r
if (_content == null)\r
return;\r
\r
+ _content.LogicalParent = this;\r
_content.Focusable = true;\r
_content.LayoutChanged += _content_LayoutChanged;\r
_content.MouseLeave += _content_MouseLeave;\r
}\r
}\r
base.ClearBinding ();\r
-\r
+ }\r
+ public override void ResolveBindings ()\r
+ {\r
+ base.ResolveBindings ();\r
+ if (Content != null)\r
+ Content.ResolveBindings ();\r
}\r
\r
[XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
#region GraphicObject overrides
public override void ClearBinding ()
{
- if (Content != null) {
- //fix datasource = null to clear bindings, but it's illogic
- Content.DataSource = this.DataSource;
+ if (Content != null)
Content.ClearBinding ();
- }
base.ClearBinding ();
}
+// public override void ResolveBindings ()
+// {
+// base.ResolveBindings ();
+// if (Content != null)
+// Content.ResolveBindings ();
+// }
public override GraphicObject FindByName (string nameToFind)
{
if (Name == nameToFind)
{
if (template == null) {
DefaultTemplate dt = (DefaultTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultTemplate), true).FirstOrDefault();
- this.SetChild (Interface.Load (dt.Path, this,!Interface.DontResoveGOML));
+ this.SetChild (Interface.Load (dt.Path, this));
+ this.child.ResolveBindings ();
}else
this.SetChild (template);
}
XmlSerializer xs = new XmlSerializer (type);
result = (GraphicObject)xs.Deserialize (stream);
- result.DataSource = hostClass;
+ //result.DataSource = hostClass;
#if DEBUG_LOAD_TIME
loadingTime.Stop ();