-1
图像在运行时未显示,它在设计器中显示。图像在运行时不显示
XAML:
<ScrollViewer Grid.Row="1" Grid.Column="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="/Assets/logo_108x108.png" Stretch="Fill" Width="400" VerticalAlignment="Top" HorizontalAlignment="Center" Height="133" Grid.RowSpan="3" />
<phone:WebBrowser x:Name="DescriptionBrowser" Grid.Row="1" Grid.RowSpan="2" Navigating="DescriptionBrowser_Navigating" Margin="0,149,0,0"/>
<TextBlock x:Name="ErrorBlock" Visibility="Collapsed" Foreground="Black" FontSize="20" Grid.Row="1" Grid.Column="1" Text="{Binding LocalizedResourcesFromCommonDll.ErrorGeneral, Source={StaticResource LocalizedCommonStrings}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Segoe UI"/>
</Grid>
</ScrollViewer>
</Grid>
我试着更换图片标签,但它仍然无法正常工作。
我试图以上述方式实施,但仍然没有显示图像.. – Rachel
在你的项目中,你有一个文件夹资源,那里的图片,你是否将'Build Action'属性设置为'Resource'?这也应该工作:“pack:// application:,,,; component/Resources/” 其中是Assembly.GetEntryAssembly()。GetName()。Name; –
Rolfi