我刚刚将xaml中的图像源从文字值更改为绑定值。在这样做时,图像加载的速度明显变慢。我在其他方面做同样的事情并没有注意到同样的问题:
从此(快速显示):
<Image Grid.Row="0" Source="/MyApp.Phone8;component/Resources/dark.png" Stretch="Uniform" Margin="10"/>
对此(显示缓慢):
<Image Grid.Row="0" Source="{Binding Image}" Stretch="Uniform" Margin="10 10 10 30"/>
public SplashPage() {
if (App.Root != null) {
_splashViewModel = App.Root.SplashViewModel;
DataContext = _splashViewModel;
}
InitializeComponent();
}
public String Image {
get {
return "/MyApp.Phone8;component/Resources/dark.png";
}
}
有没有办法解决性能滞后问题?这是第一次显示图像。