Silverlight(4) - 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image
2008-11-14 11:50:51 来源:WEB开发网6、Image.xaml
<UserControl x:Class="Silverlight20.Control.Image"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<!--
Source - 程序目录下的图片文件地址
-->
<Image Source="/Logo.jpg" Margin="5" Width="100" />
<!--
Source - 程序集内的图片文件地址 [/程序集名;component/图片路径]
-->
<Image Source="/Silverlight20;component/Images/Logo.jpg" Margin="5" Width="200" />
<!--
Source - 互联网的图片文件地址
-->
<Image Source="http://silverlight.net/Themes/silverlight/images/logo.jpg" Margin="5" Width="100" />
<!--
Source - 后台方式设置Image的Source
-->
<Image x:Name="img" Margin="5" Width="100" />
</StackPanel>
</UserControl>
Image.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;
namespace Silverlight20.Control
{
public partial class Image : UserControl
{
public Image()
{
InitializeComponent();
// 后台方式设置Image的Source
img.Source = new BitmapImage(new Uri("/Silverlight20;component/Images/Logo.jpg", UriKind.Relative));
}
}
}
OK
Tags:Silverlight 控件 DataGrid
编辑录入:爽爽 [复制链接] [打 印]- ››DataGrid中CheckBox绑定bool属性来进行选中判断
- ››silverlight全屏显示图片
- ››控件一:Gallery 之无限循环的问题
- ››控件一:Gallery 之基础用法
- ››Silverlight MVVM 模式(一) 切近实战
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
- ››datagridview checkbox控件
- 中查找“Silverlight(4) - 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image”更多相关内容
- 中查找“Silverlight(4) - 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image”更多相关内容
- 上一篇:Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton
- 下一篇:Silverlight(3) - 2.0控件之Border, Button, Calendar, Canvas, CheckBox, ComboBox
更多精彩
赞助商链接