Nic*_*nto 4 icons windows-phone-7
我正在开发我的第一个Windows Phone 7应用程序,我必须添加带有图标的应用程序栏.
I referred to this "How To" : http://msdn.microsoft.com/en-us/library/ff431786(VS.92).aspx ("Creating an Application Bar in XAML" paragraph)
But when I run Emulator I cannot see incons: I see the black circle with X in the center and event ApplicationBarIconButton_Click correctly raised.
I'm using icon from WP7AppBarIcons.zip samples and my code is posted below:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/images/appbar.transport.play.rest.png" Text="Home" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/images/appbar.favs.rest.png" Text="Preferiti" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/images/appbar.questionmark.rest.png" Text="About" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
Run Code Online (Sandbox Code Playgroud)
Obviously, I have a root solution folder named "images" containing the mentioned 48 x 48 icons.
Thanks a lot!
Rog*_*oid 13
图像Build Action是否设置为"Content"而不是"Resource",因为这是一个常见的错误 - 我自己已经完成了几次.它们需要这样,因为ApplicationBar不是Silverlight控件,并且图像需要设置为Content.