Note that there are some explanatory texts on larger screens.

plurals
  1. POStoryboard in custom control
    primarykey
    data
    text
    <p>I have an usercontrol in silverlight that I'm trying to convert to custom control. The usercontrol is working. The customcontrol is working BUT has its storyboard not working.</p> <p>the control is :</p> <pre><code>public class MyControl : Control { public MyControl() { DefaultStyleKey = typeof(MyControl); } public static readonly DependencyProperty IsStartingProperty = DependencyProperty.Register("IsStarting", typeof(bool), typeof(MyControl), new PropertyMetadata(new PropertyChangedCallback(OnIsStartingChanged))); private static void OnIsStartingChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { MyControl control = obj as MyControl; if (control != null &amp;&amp; control._layoutRoot != null &amp;&amp; control._storyboard != null) { if ((bool)e.NewValue) { control._layoutRoot.Visibility = Visibility.Visible; control._storyboard.Begin(); } else { control._layoutRoot.Visibility = Visibility.Collapsed; control._storyboard.Stop(); } } } private Canvas _layoutRoot; private Storyboard _storyboard; public override void OnApplyTemplate() { _layoutRoot = GetTemplateChild("LayoutRoot") as Canvas; _storyboard = GetTemplateChild("IndicatorStoryboard") as Storyboard; base.OnApplyTemplate(); } public bool IsStarting { get { return (bool)GetValue(IsStartingProperty); } set { SetValue(IsStartingProperty, value); } } } </code></pre> <p>On debug, no error on control._storyboard.Begin();, but I can't see the animation ...</p> <p>Does someone has an idea ? How to work with storyboard ?</p> <p>Thanks in advance for any help</p> <p>EDIT : Full source sample is available : <a href="http://vpclip.virtua-peanuts.net/WindowsPhoneApplication1.zip" rel="nofollow">http://vpclip.virtua-peanuts.net/WindowsPhoneApplication1.zip</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload