我有image control在 UWP 页面中。我写了位于其他项目中的源路径,但图像不显示,也不显示设计器或运行时。如何解决这个问题?
<Page
x:Class="Platform.Universal.LoadingWindow.LoadingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="Transparent">
<Grid>
<Image x:Name="LoadingImage"
Stretch="Fill"
Source="ms-appdata:///Resources.Universal/Resources/ChangableFiles/Default/LoadingImage.png" />
</Grid>
最佳答案
你不能。如果您在 list 中设置了 broadFileSystemAccess
,那么您唯一可能这样做的方法是,然后从后面的代码中的文件系统路径加载图像并分配它(或从 View 模型中类似的东西) .
但请注意,在 Microsoft Store 上几乎可以肯定,如果这是请求它的原因,您的应用将被拒绝使用 broadFileSystemAccess
。
关于c# - 如何从另一个项目绑定(bind) UWP 项目图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54883673/