view文件
<Image Grid.Column="2"
Width="48"
Height="64"
Stretch="Fill"
Source="{Binding CaseCoverImage}"
UseLayoutRounding="True" />
model文件
public BitmapImage CaseCoverImage
{
get { return this.GetValue(c => c.CaseCoverImage); }
set { this.SetValue(c => c.Image, CaseCoverImage); }
}
viewmodel文件
BitmapImage defImage = new BitmapImage();
defImage.BeginInit();
defImage.UriSource = new Uri("/VIS3000V4;component/Images/test/大客车.jpg", UriKind.Relative);
defImage.EndInit();
CaseCoverImage=defImage ;