views:

220

answers:

3

I have a user control and I want to create a property of type storyboard which I can set in xaml, so I tried to following, but I get a bad property error when I run it:

private Storyboard sbTransitionIn_m;
public Storyboard TransitionIn
{
    get {return sbTransitionIn_m;}
    set {sbTransitionIn_m = value;}
}

xaml:

<MyStuff:MyUserControl x:Name="ctlTest" TransitionIn="sbShow"/>
+1  A: 

Storyboard can't serialize from a string attribute like that. Try this:

<MyStuff:MyUserControl x:Name="ctlTest">
    <MyStuff:MyUserControl.TransitionIn>
        <Storyboard/>
    </MyStuff:MyUserControl.TransitionIn>
</MyStuff:MyUserControl>
Michael S. Scherotter
+2  A: 

Define the storyboard in Resources and then refer it as staticresource

<UserControl.Resources>
   <Storyboard x:Key="sbShow">
     <!--  -->
   </Storyboard>
</UserControl.Resources>

<MyStuff:MyUserControl x:Name="ctlTest" TransitionIn="{StaticResource sbShow}"/>
rravuri
A: 

hi…please i need help…i have animation in silverlight with one storyboadr…and i need after push button set a new value of time and resume storyboard…can you halp me please:-)…thank you..;-)