DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions

I posted around some news groups to find an answer about my crash and a I recieved the following reply from Mike Hillbert.When you’re animating Width or Height, you have to specify both the From and the To, or you have to have specified the base value somewhere (e.g. on the element itself).That’s because when you don’t specify the From or To it gets inferred from the base (unanimated) value. And in the case of Width and Height, the base value often isn’t known until later when layout runs.


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

<p>I posted around some news groups to find an answer about my crash and a I recieved the following reply from Mike Hillbert.<p /><blockquote>When you're animating Width or Height, you have to specify both the From and the To, or you have to have specified the base value somewhere (e.g. on the element itself).<p />That's because when you don't specify the From or To it gets inferred from the base (unanimated) value. And in the case of Width and Height, the base value often isn't known until later when layout runs.<p />For example, in this page<p /><Page ...> ... <Page.Storyboards> <SetterTimeline TargetName="btn" Path="(Button.Width)" > <DoubleAnimation From="50" /> </SetterTimeline> </Page.Storyboards> ... <Button Width="100" Name="btn" Background="Blue">Click</Button> ...</Page><p />the button's width is explicitly set on the <Button>, so the animation implicitly takes the width to 100 (from 50). But if you don't have the Width set in the <Button>, and don't have it anywhere else (e.g. in a Style), you have to have the From on the DoubleAnimation.</blockquote><p />I think it basically sums up the problem quite simply. I wasn't giving the actual MenuItem a width, the "Owner Draw" elements in the Visual Tree had a width but the actual menu item didn't. Funnily enough (Well it is not that funny), I tried the suggested fixes and the crash was still occuring. I also tried the following bit of XAML which is supposed to give every control that meets the style criteria a width of 200:<p /><blockquote class="posterous_short_quote"><Style TargetType="{x:Type MenuItem}" x:Key="{x:Type MenuItem}" > <Setter Property="Width" Value="200" /> ... ...</blockquote><p />I think my next course of action is to try and get this in a proper WinFX application rather than just XAMLPad.</p>


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2005-06-10T00:00:00+00:00) DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions. Retrieved from https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/

MLA
" » DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions." Paul Kinlan | Sciencx - Friday June 10, 2005, https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/
HARVARD
Paul Kinlan | Sciencx Friday June 10, 2005 » DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions., viewed ,<https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/>
VANCOUVER
Paul Kinlan | Sciencx - » DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/
CHICAGO
" » DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/
IEEE
" » DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/. [Accessed: ]
rf:citation
» DoubleAnimation Crashes XAMLPad (MayCTP): Some Answers To Questions | Paul Kinlan | Sciencx | https://www.scien.cx/2005/06/10/doubleanimation-crashes-xamlpad-mayctp-some-answers-to-questions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.