2)try
{Binding
ElementName=vb,Path=ActualWidth,Mode=OneWay,Converter={StaticResource
...},ConverterParameter={Binding
ElementName=zz1,Path=Width,Mode=OneTime}}
If Width value of zz1 already binded to another "Binding" expression
you'll get "System.Data.Binding" instead of "Double" in
ConverterParameter-strange...I wanted value of property but not
mechanism it's coming from.
Regards.
Thanks,
Karsten
<sa.c...@gmail.com> wrote in message
news:1128683325.2...@f14g2000cwb.googlegroups.com...
> 1)if you try {Binding XPath=@x,Converter={StaticResource...}}
> in Converter you get "string"(Value of attribute) not XmlAttribute
> itself-someone already partially convert XmlAttribute;-)But if you try
> Path=Attributes[x] all works as expected.
I just wanted to weigh in with my opinion that this one seems to work exactly
how I would expect.
I would expect the XPath statement to evaluate and give me the value of the
attribute back according to XPath semantics. Imagine you had written XPath=boolean(@x)
instead. Wouldn't you expect a boolean value? The fact that you can get at
the underlying DOM XmlAttribute instance via the Path approach is actually
awesome because it gives you exactly what you want without tainting the XPath
approach.
Just my 2¢,
Drew
2) ConverterParameter is not a DependencyProperty and hence not
databindable. It can only be set to a literal. If you try to set it to a
Binding, the value of the Converter is set to the Binding, since it does not
support expressions which would help to evaluate the Binding. This is a
feature we decided not to support in V1. A work around for this would be to
use MultiBinding and MultiValueConverter which would let you provide more
than one bindings as input to a single MultiValueConverter.
Thanks
Namita Gupta [MSFT]
<sa.c...@gmail.com> wrote in message
news:1128683325.2...@f14g2000cwb.googlegroups.com...
2)I'll try MultiBinding in my scenario,as you see I want to calculate
dynamic coefficient(for proper scaling of Polyline's Thickness in my
case).
One more thing,do you have any "ordering/routing" strategy for binding
mechanism?Suppose,I've {Binding} on Width property of "zz1" element and
use {Binding ElementName=zz1,Path=Width,Mode=OneTime,Converter=...} on
other's element property.In my case I'll get NaN-Width not binded
yet,if I change to "Mode=OneWay" I'll get correct,"binded" value second
time in my converter.Is there any means to chaining Binding,include
some kind of dependency mechanism for binding ordering?
Thanks a lot.
Best wishes.
Any ideas,what could be wrong?
Thanks.
Reference error: cannot find element with given name 'vb'.
BindingExpression path error: Cannot find property 'ActualWidth' on
object 'null'.
BindingExpression:Path='ActualWidth'; DataItem='null';
target element is 'Polyline' (Name=''); target property is
'StrokeThickness' (type Double);
Binding's ElementName feature only searches the nearest INameScope, which
in this case is the DataTemplate. Try using RelativeSource instead. Like so:
{Binding RelativeSource=/TemplatedParent, Path=ActualWidth, Mode=OneWay,
Converter={StaticResource ...}}
HTH,
Drew
___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/
> Thanks,Drew,but /TemplatedParent refer to element itself but I need
> another,hence ElementName...
Sorry, I was just going by your example. Yeah basically RelativeSource is
only going to help you work your way up through the element tree, so if you're
trying to reach out to some other random element it's not gonna help.
Good luck,
Thanks
Namita[MSFT]
<sa.c...@gmail.com> wrote in message
news:1128786693....@f14g2000cwb.googlegroups.com...