[Ironruby-core] problem with WPF animation.Duration= and TimeSpan

Meinrad Recheis meinrad.recheis at gmail.com
Mon Feb 16 09:34:01 EST 2009


Hi all,

Once again I am hitting some unexpected behavior in IronRuby. Might be a bug
;)

>>> animation = System::Windows::Media::Animation::DoubleAnimation.new()
=> #<System::Windows::Media::Animation::DoubleAnimation:0x000005c>

>>> animation.Duration= System::Windows::Duration.new(
System::TimeSpan.FromSeconds(2))
=> #<System::Windows::Duration:0x000005e>

>>> animation.Duration= System::Windows::Duration.Forever
=> #<System::Windows::Duration:0x0000060>


So far everything works as expected. Now trying to directly set a timespan
which should be possible in C#:

>>> animation.Duration= System::TimeSpan.FromSeconds(2)
:0: can't convert System::TimeSpan into System::Windows::Duration
(TypeError)


ok, automatic conversion seems not yet to work here ... but the next thing
is really strange:

>>> animation.Duration= System::Windows::Duration.new(
System::TimeSpan.FromSeconds(2))
:0: can't convert System::TimeSpan into System::Windows::Duration
(TypeError)

>>> animation.Duration= System::Windows::Duration.Forever
:0: can't convert System::TimeSpan into System::Windows::Duration
(TypeError)

>>> ???

What has already worked now doesn't any more, depending on the value that
has been set before. You will probably know what is going on.

Cheers,
-- henon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090216/54888b76/attachment-0001.html>


More information about the Ironruby-core mailing list