How to do Silverlight overlay element -



How to do Silverlight overlay element -

i starting larn sl... trying create mediaelement of size x, , on bottom of film frame subtitles run. unable understand if need absolute position or else.

please advice

thanks

if need subtitle need set textblock under mediaelement on grid , need give verticalallignment property bottom on xaml. , on it. this;

<grid> <mediaelement/> <textblock verticalallignment="bottom"/> </grid>

you may refer grid layout relative positioning if you're new silverlight. , can give margin textblock or want take @ intellisense (if using vs) , you'll understand, if you're using look blend it'll lot easier ui.

if want utilize absolute positioning you'll need utilize canvas instead of grid layout, same , can alter canvas no problem. in canvas, need utilize left , right properties instead of allignments. this;

<canvas> <mediaelement/> <textblock canvas.left="0" canvas.top="400"/> </canvas>

another alternative stackpanel not suitable layoutroot, pretty nice controls. if want subtitles remain under film should utilize stackpanel this;

<stackpanel orientation="vertical"> <mediaelement/> <textblock/> </stackpanel>

so sum up;

-if want subtitles on top of film utilize grid first example,

-if have fixed size , want place subtitles anywhere want utilize canvas,

-and if want set subtitles under film utilize stackpanel.

-my personal selection grid. =)

for more info may check article seems nice one! http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-2-using-layout-management.aspx

happy coding!!

silverlight

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -