silverlight for win phone常用控件(续)

Grid网格控件

            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>         //定义两行
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>     //定义两列
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Image Grid.Row="0" Grid.Column="0" Height="270" Source="/Image/bing.jpg" HorizontalAlignment="Left" Margin="6,6,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="350" /> 
             //将图片填充到第一个网格

mediaElemen播放控件,支持音频和视频播放

  try
            {
                mediaElement1.AutoPlay = true;
                mediaElement1.Source = "";
                mediaElement1.Position = TimeSpan.FromMilliseconds(0);
                mediaElement1.Play();
            }
            catch
            {
            }

posted @ 2010-12-14 15:36  helloxyz  Views(205)  Comments(0Edit  收藏  举报