Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Why AutoPlay instead of LoadedBehavior?
3 replies. Latest Post by Psychlist1972 on October 2, 2007.
(0)
Psychlis...
Contributor
6045 points
973 Posts
09-23-2007 8:54 PM |
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
swildermuth
Star
8320 points
1,546 Posts
09-30-2007 4:14 PM |
I asked the same question some time ago...
http://silverlight.net/forums/t/4983.aspx
Still no answer...
esendir
Member
16 points
3 Posts
10-02-2007 9:10 AM |
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
esendir.net
10-02-2007 9:57 AM |
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.