Windows phone 7 为什么图像没有出现在WP7中的以下布局中?

Windows phone 7 为什么图像没有出现在WP7中的以下布局中?,windows-phone-7,Windows Phone 7,以下是当点击图钉显示以下布局时的布局设计。在该图像中不可见?请告诉我 <Style x:Key="MenuItemsStyle" TargetType="sltkit:MenuItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="s

以下是当点击图钉显示以下布局时的布局设计。在该图像中不可见?请告诉我

<Style x:Key="MenuItemsStyle" TargetType="sltkit:MenuItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="sltkit:MenuItem">
                            <StackPanel>
                                <TextBlock Text="{Binding Name}" 
                                           TextWrapping="Wrap" 
                                           Margin="24,0" 
                                           FontSize="26"/>
                                <TextBlock Text="{Binding Description}" 
                                           TextTrimming="WordEllipsis" 
                                           Margin="24,0" 
                                           FontSize="22"/>
                                <TextBlock Text="{Binding DatetimeAdded}" 
                                           TextTrimming="WordEllipsis" 
                                           Margin="24,0" 
                                           FontSize="22"/>
                                <Image  Source="/MyBuddies;component/Images/decline.png" Height="20" Width="20" Margin="200,0" Stretch="Fill" Name="imgDecline" >
                                </Image>
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


所有文本块值都已绑定,但图像未显示在版面中。请告诉我。

您需要将图像设置为项目中的资源,以便显示

我认为它们通常作为内容项添加


Rupert

如果图像的构建操作是“资源”,则可以按指定的方式访问它


检查此项以了解有关构建类型及其用法的更多信息。

是的,我将其设置为资源,但没有使用。我认为保证金问题。您能看一次吗。在我们的系统中重现您的问题并不容易。我们不确定您在页面中放置了哪些其他控件。因此,首先在普通页面中使用相同的图像,并确保其呈现。然后尝试更改边距值Show,以便在单击该版面中的图像时进行导航。我将该版面设计代码放置在app.xaml中。在该导航服务中,该代码不起作用。