Skip to main content

Microsoft Silverlight

Why AutoPlay instead of LoadedBehavior?RSS Feed

(0)

Psychlist1972
Psychlis...

Contributor

Contributor

6045 points

973 Posts

MicrosoftModerator

Why AutoPlay instead of LoadedBehavior?

I'm all for party between WPF and SIlverlight whenever the elements could or should be the same.

In Silverlight 1.1, the MediaElement has an AutoPlay boolean property that directs whether or not to play the media file when loaded.

WPF has a LoadedBehavior property that allows: Close, Manual, Pause, Play, Stop.

I'd suggest changing SL to have the same as WPF, especially in this case (and other cases, even if it means 1.1 breaks 1.0 when released - it's easier to justify with a 1.1 than a 3.0 or something). It will make porting apps easier, and will also avoid what appears to be pointless syntax differences that will make knowledge transfer harder.

Pete

Silverlight.net Moderator
MVP: Silverlight, Silverlight Insider
Author: Silverlight in Action, 2nd Edition
POKE 53280,0 - My Blog

Opinions are my own. Oh, and I don't work for Microsoft.

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Re: Why AutoPlay instead of LoadedBehavior?

I asked the same question some time ago...

http://silverlight.net/forums/t/4983.aspx

 Still no answer...

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

esendir
esendir

Member

Member

16 points

3 Posts

Re: Why AutoPlay instead of LoadedBehavior?

In SL 1.0 there are two tags.

First one is autoplay as below

<Canvas.Triggers>
  <EventTrigger RoutedEvent="Canvas.Loaded">
     <BeginStoryboard>
        <Storyboard x:Name="xxx">

Second one will play when you call Begin() method as below
<Canvas.Resources>
  <Storyboard x:Name="xxx">

If you want to stop the autoplay move your storyboard from first place to second.
Don't forget to close the tags Stick out tongue

 

esendir.net

 

Üsame F. Esendir | esendir.net

Psychlist1972
Psychlis...

Contributor

Contributor

6045 points

973 Posts

MicrosoftModerator

Re: Re: Why AutoPlay instead of LoadedBehavior?

Thanks esendir, but I don't think we're talking about the same thing

Shawn and I are talking about the property of the MediaElement. 

Pete

Silverlight.net Moderator
MVP: Silverlight, Silverlight Insider
Author: Silverlight in Action, 2nd Edition
POKE 53280,0 - My Blog

Opinions are my own. Oh, and I don't work for Microsoft.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities