c# - Ellipse move animation inside ItemsControl with Canvas template -


Using double animations, attached property canvas. Left should be set to 100 slowly:

  & lt; Ellipse Width = "30" Height = "30" Fill = "Purple" & gt; & Lt; Ellipse.Triggers & gt; & Lt; EventTrigger Routing Avent = "Elips. Loaded" & gt; & Lt; BeginStoryboard & gt; & Lt; Storyboard & gt; & Lt; Double animation duration = "0: 0: 5" storyboard. Targetproperty = "repeat =" 100 "(canvas.lift)" deny = "always" /> & Lt; / Storyboard & gt; & Lt; / BeginStoryboard & gt; & Lt; / EventTrigger & gt; & Lt; /Ellipse.Triggers> & Lt; / Ellipse & gt;   

This oval (part of a dataplatform for my view model) items are bundled on the control through iTsTront:

  & lt; Items control itemsource = "{binding component}" & gt; & Lt; ItemsControl.ItemsPanel & gt; & Lt; ItemsPanelTemplate & gt; & Lt; Canvas background = "beige" /> & Lt; / ItemsPanelTemplate & gt; & Lt; /ItemsControl.ItemsPanel> & Lt; ItemsControl.ItemContainerStyle & gt; & Lt; Style TargetType = "ContentPresenter" & gt; & Lt; Setter Property = "canvas.lift" value = "{binding X}" /> & Lt; Setter property = "canvas.Tap" value = "{binding y}" /> & lt; / Style & gt; & Lt; /ItemsControl.ItemContainerStyle> & Lt; / ItemsControl>   

However, when the oval load is loaded, the following exception occurs:

  Do not animate 'left' property on 'System.Windows.Shapes' can do. A 'system Windows Media Animation 'double animation' using 'oval'   

But the destination of the animation is referred to as the property "canvas left." And is not "left"?

You need to start the canvas for the double animation. To start working:

  & lt; Ellipse Width = "30" Height = "30" Fill = "Purple" canvas. Lift = "0" & ​​gt;    

Comments