无法将图像放入集线器磁贴中

时间:2012-02-05 13:58:42

标签: windows-phone-7 silverlight-toolkit

我试图将一些图像放入集线器磁贴中作为窗口电话7设计,但我发现即使我完全按照电子书,但我仍然无法将图像放入其中。 有人请吗?

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>

背后的代码

 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;
        }
    }

任何人都会。感谢

1 个答案:

答案 0 :(得分:1)

从你的路径来看,我会说它是“建立行动”。您可能想要检查您尝试显示的图像是否将其“构建操作”设置为内容。