0

according to this MSDN article, there should be an Application Bar template in every generated Xaml File for Windows Phone Projects:

Locate the sample Application Bar element, which is added to your page by default. It looks like the following.

I've created a new empty Windows Phone 8 project in Visual Studio 2012 and I'm missing the App Bar template which was visible when I developed for Windows Phone 7. Is this only deactivated or do I need to copy and paste the code snippet for the creation of an App Bar when I'm developing Windows Phone 8 projects?

4

1 に答える 1

0

XAML コードを次のように WP8 プロジェクトにコピー アンド ペーストする以外に解決策はありませんでした (このページから取得したコード)。

<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar Opacity="1" IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.Buttons>
               <shell:ApplicationBarIconButton IconUri="/Images/appbar.add.rest.png"
Text="add">
               </shell:ApplicationBarIconButton>          


<shell:ApplicationBarIconButton IconUri="/Images/appbar.save.rest.png"
Text="save">
               </shell:ApplicationBarIconButton>
               <shell:ApplicationBarIconButton IconUri="/Images/appbar.delete.rest.png"
Text="delete">
               </shell:ApplicationBarIconButton>
            </shell:ApplicationBar.Buttons>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Menu Item 1" IsEnabled="True">
                </shell:ApplicationBarMenuItem>
                <shell:ApplicationBarMenuItem Text="Menu Item 2" IsEnabled="True">
                </shell:ApplicationBarMenuItem>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>    

Microsoftは、ローカライズ可能な ApplicationBarを使用することをユーザーに推奨しています。

于 2013-01-07T09:06:09.037 に答える