Search code examples
visual-studiowindows-phone-7windows-phone

Application bar not available


I have recently downloaded Windows Phone Toolkit (November 2011, 7.1 SDK) but I do not see a few icons in my Visual Studio toolbox like Application bar, am I missing some other installations?


Solution

  • Controls (like Panorama, Pivot, AppBar) aren't in the Toolbox, because they're not widgets like buttons, text boxes, etc - the compiler treats them differently, and they're not designed to be 'placed' anywhere or used multiple times on a page like widgets are.

    Here's the XAML for the panorama, pivot and app bar, copied from the default projects, for reference;

    Panorama

    <controls:Panorama Title="my panorama">
                <controls:Panorama.Background>
                    <ImageBrush ImageSource="PanoramaBackground.png"/>
                </controls:Panorama.Background>
                <controls:PanoramaItem Header="nearby" Orientation="Horizontal" Width="880">
    <!--stuff goes here-->
                </controls:PanoramaItem>
    </controls:Panorama>
    

    Pivot

    <controls:Pivot Title="my pivot">
            <controls:PivotItem Header="item 1">
                <!-- stuff goes here -->
            </controls:PivotItem>
    </controls:Pivot>
    

    App bar

    <phone:PhoneApplicationPage.ApplicationBar>
            <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
                <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
                <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
                <shell:ApplicationBar.MenuItems>
                    <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                    <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
                </shell:ApplicationBar.MenuItems>
            </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>