边框内的MediaElement [英] MediaElement inside border

查看:140
本文介绍了边框内的MediaElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格作为我的最外层元素,在其中一行中我有一个border元素,然后是一个media元素。媒体元素填充到网格行的大小。我需要设置什么来确保媒体元素保持在边框内?

< Border Height =" Auto"宽度= QUOT;自动"余量= QUOT; 10,10,10,10"填充= QUOT; 5,5,5,5" Grid.Row = QUOT 1 QUOT; Grid.Column =" 0">
< Media />
< / Border>

I have a grid as my outermost element and in one of the rows I have a border element and then a media element. The media element fills to the size of the grid row. What do I need to set to ensure the media element stays inside the border?

<Border Height="Auto" Width="Auto" Margin="10,10,10,10" Padding="5,5,5,5" Grid.Row="1" Grid.Column="0">
<Media/>
</Border>

推荐答案

是您的媒体元素大于你的边界?如果您有明确设置的尺寸(例如720x480),并且您的边框要么小于该尺寸,要么折叠到小于该尺寸,那么您将遇到麻烦。

如果是这种情况,您可以将最小高度和最小宽度属性设置为边框,该属性等于媒体元素的大小+边框填充,或者您可以将媒体元素包装在滚动查看器中以包含它在边框大小内。
Is your media element bigger than your border? If you have an explicitly set size (say 720x480), and your border is either smaller than that size or can collapse to smaller than that size, you're going to be in trouble.

If that's the case, you can either set min height and min width attributes to your border that are equal to the media element's size + the border padding, or you can wrap the media element in a scroll viewer to contain it within the border size.


这篇关于边框内的MediaElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆