Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 无法将图像放入中心磁贴_Windows Phone 7_Silverlight Toolkit - Fatal编程技术网

Windows phone 7 无法将图像放入中心磁贴

Windows phone 7 无法将图像放入中心磁贴,windows-phone-7,silverlight-toolkit,Windows Phone 7,Silverlight Toolkit,我试图将一些图像作为WindowsPhone7的设计放入hub互动程序中,但我发现即使我完全遵循电子书,但我仍然无法将图像放入其中。 有人吗 XAML代码 <ListBox Grid.Row="0" x:Name="tileList"> <ListBox.ItemsPanel> <ItemsPanelTemplate>

我试图将一些图像作为WindowsPhone7的设计放入hub互动程序中,但我发现即使我完全遵循电子书,但我仍然无法将图像放入其中。 有人吗

XAML代码

  <ListBox Grid.Row="0" x:Name="tileList">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <toolkit:WrapPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <toolkit:HubTile Title="{Binding Title}" Margin="3" Notification="{Binding Notification}"
                                        DisplayNotification="{Binding DisplayNotification}" Message="{Binding Message}" 
                                             GroupTag="{Binding GroupTag}" Source="{Binding ImageUri}"> 
                            </toolkit:HubTile>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

任何人都可以。谢谢

从你的道路判断,我认为这是“构建行动”。您可能需要检查您试图显示的图像是否将其“构建操作”设置为“内容”。

从路径的方式判断,我认为是“构建操作”。您可能需要检查您试图显示的图像是否将其“构建操作”设置为内容。

图像已添加到/imagesI means content/resource选项:)图像已添加到/imagesI means content/resource选项:)感谢您的回复。我查过了。其构建操作已设置为资源。谢谢。因此,默认的解决方法是更改内容?或设置图像路径,如“yourassemblyname;component/images/Hard.jpg”@CarsonLee默认情况下,它是作为资源添加的。但出于性能目的,您应该将其更改为内容,并遵循您在问题中使用的路径。原因是,当您将其作为资源添加到应用程序时,它会存储在应用程序的dll文件中,从而增加应用程序加载所需的时间。谢谢。这对我帮助很大=)结论最好改成内容,对吗?=)谢谢你的回复。我查过了。其构建操作已设置为资源。谢谢。因此,默认的解决方法是更改内容?或设置图像路径,如“yourassemblyname;component/images/Hard.jpg”@CarsonLee默认情况下,它是作为资源添加的。但出于性能目的,您应该将其更改为内容,并遵循您在问题中使用的路径。原因是,当您将其作为资源添加到应用程序时,它会存储在应用程序的dll文件中,从而增加应用程序加载所需的时间。谢谢。这对我帮助很大=)结论最好改成内容,对吗?=)
 List<TileItem> tileItems = new List<TileItem>()
            {
                new TileItem()
                {
                    ImageUri="/Images/logo.png", Title="Work Hard", Notification = "Work Hard", GroupTag="TileGroup"
                },
                new TileItem()
                {
                    ImageUri="/Images/Hard.jpg", Title="Work Smart", Notification = "Work Smart", GroupTag="TileGroup"
                },
                new TileItem()
                {
                    ImageUri="/Images/Hard.jpg",
                    Title = "Play Smart",
                    Message = "Look Smart"
                },
                new TileItem()
                {
                    ImageUri="/Images/Hard.jpg",
                    Title = "Sleep Smart",
                    Message = "Sleep Smart"
                },
                new TileItem()
                {
                    ImageUri="/Images/Hard.jpg",
                    Title = "Sleep Hard",
                    Message = "Sleep Hard"
                },
                new TileItem()
                {
                    ImageUri="/Images/Hard.jpg", Title="Play Hard", Notification = "Play Hard", GroupTag="TileGroup"
                }
            };
   public class TileItem
    {
        public string ImageUri
        {
            get;
            set;
        }

        public string Title
        {
            get;
            set;
        }

        public string Notification
        {
            get;
            set;
        }

        public bool DisplayNotification
        {
            get
            {
                return !string.IsNullOrEmpty(this.Notification);
            }
        }

        public string Message
        {
            get;
            set;
        }

        public string GroupTag
        {
            get;
            set;
        }
    }