wpf - MediaElement layout to occupy entire space -


below xaml code in have mediaelement , 3 button hosted inside grid.

<grid showgridlines="true">   <grid.background>     <lineargradientbrush endpoint="0.5,1"                          startpoint="0.5,0">       <gradientstop color="black"                     offset="0" />       <gradientstop color="#ff4f87f7"                     offset="1" />     </lineargradientbrush>   </grid.background>   <grid.rowdefinitions>     <rowdefinition height="7*" />     <rowdefinition height="35" />   </grid.rowdefinitions>   <grid.columndefinitions>     <columndefinition width="10*" />     <columndefinition width="auto" />     <columndefinition width="5*" />     <columndefinition width="1*" />   </grid.columndefinitions>   <border grid.columnspan="4"           horizontalalignment="stretch"           grid.row="1"           borderthickness="2"           cornerradius="5"           borderbrush="black">      <stackpanel orientation="horizontal"                 horizontalalignment="center">       <button width="100"               content="previous"               style="{dynamicresource buttonmargin}" />       <button width="100"               content="play"               style="{dynamicresource buttonmargin}"               click="button_click" />       <button width="100"               content="next"               style="{dynamicresource buttonmargin}" />       <togglebutton style="{dynamicresource togglebuttonmargin}">full screen</togglebutton>     </stackpanel>    </border>   <mediaelement  name="me"                  horizontalalignment="stretch"                  loadedbehavior="manual"                  verticalalignment="top"                  grid.issharedsizescope="true" />   <gridsplitter grid.column="1"                 width="3"                 horizontalalignment="center" />   <webbrowser name="webbrowserscript"               grid.column="2" /> </grid> 

problem: aim render mediaelement in 0th row , 0th column , should occupy entire space. however, mediaelement not streaching entirely , not occupying entire space. tried possible combinations of horizontalalignment , verticalalignment. can help? regards, hemant

got it.. need use stretch property of media element.

<mediaelement  name="me" horizontalalignment="stretch" loadedbehavior="manual"                    verticalalignment="stretch" stretch="fill"/> 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -