-
I'm trying to use these implicit animations in a ToggleButton but animations:ColorAnimation throws an exception at load time.
I copied these animations from the toolkit's implicit animations example and added the ColorAnimation (commented out here) I also want to use a simple rotation animation, the one above the ColorAnimation, but that doesn't trigger, the contorl rotates at full speed around the top left corner. The other thing is that I can't find the correct way to change the rotation origin to the center of the control.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@gmgallo Wrt the centerpoint: you can use the
|
Beta Was this translation helpful? Give feedback.
-
Hi Niels, I didn't create that ColorAnimation. I thought that it was part of the toolkit because it pops up as one of the options in Visual Studio when you start typing the class name in the xaml editor. It may be part of the Framework then, but the help on that comes empty. On the RotationInDegreesAnimation, why it doesn't trigger? should it be declared in some other way ? Tanks for the hint on how to relocate the origin. It takes time to learn all the ins and outs of this great toolkit. One implicit animations I would like to suggest one that triggers when the control content changes. I'm replacing Icons on that togglebutton depending on the current state of the application (hourglass, start, stop,etc.), but havent found an elegant way to do it in Xaml alone, and don't have the time to develop a custom control just for that, so, I do it quick and dirty on the code behind. Any suggestions for this? |
Beta Was this translation helpful? Give feedback.
ColorAnimation
: yeah, I believe it's part of the platform. Check theAnimations
section in the WinUI Gallery, there are some things listed thereBrushTransition
could be of help?RototationInDegreesAnimation
: https://github.com/CommunityToolkit/Windows/blob/bef863ca70bb1edf8c940198dd5cc74afa5d2aab/components/Animations/samples/AnimationsImplicitSample.xaml might be of helpShowing content:
SwitchPresenter
could be useful for this: https://github.com/CommunityToolkit/Windows/blob/bef863ca70bb1edf8c940198dd5cc74afa5d2aab/components/Primitives/samples/SwitchPresenter/SwitchPresenterValueSample.xaml