How to Animate (fade) a tube fill (SolidColorBrush) in the Flights Demo?

Anonymous 9 years ago 0
This discussion was imported from CodePlex

BogusException wrote at 2014-07-07 04:08:


I've been at it all day, trying everything I can find on the Internet. All I want to do is have the 'flight' tube (flight path) fade over time.

Right now the program is complaining that no mater which Dispatcher.BeginInvoke I use, I can't access the Fill property of the tube from the thread I'm on. I've tried the Flight's thread and the 'parent' thread, but VS doesn't give you much beyond the line number and {"The calling thread cannot access this object because a different thread owns it."} ...

I even try creating a new SolidColorBrush, and then applying that to the tube as tube.Fill, but no joy-the same error...

Is the AnimateOpacity extension made for this kind of thing? I asked earlier about it, as I can't find any docs on it, and just invoking it as it says to fails with no feedback.


objo wrote at 2014-07-11 21:54:

Make sure the material is not frozen and you are calling from the right thread. Animation should work as everywhere else in WPF.