views:

100

answers:

0

There are a few issues I notice with the beta version of the WP7 tools:

  • The ApplicationBar no longer causes a page to resize it contents with the CTP workaround
  • Using the ApplicationBar from App.xaml and imported as a static resource does not work as expected

In the CTP version of the WP7 tools when using an appbar and navigation from page to page, the appbar remainined on top of the page content rather than having the content resize itself to be on top of the appbar. The work around was to set the IsVisible property to false in the constructor and set to true on the page loaded event. This is no longer working and the appbar remains on top of the loaded page unless turned completely off. I have my appbar xaml in app.xaml and each page uses it as a static resource.

Also the click event is no longer triggered for app buttons, I am using the appbar as a resource in my App.xaml and added as a {StaticResource} in my page's xaml. Any help would be appreciated as this is the only way I have for navigating around my application, aside from rolling my own navigation page.

public CalculatorView()
{
    InitializeComponent();

    ApplicationBar.IsVisible = false;

    SupportedOrientations = SupportedPageOrientation.Portrait;

    Application.Current.RootVisual = this;
}

private void PhoneApplicationPageLoaded(object sender, RoutedEventArgs e)
{
    ApplicationBar.IsVisible = true;
}

AppBar XAML:

<Shell:ApplicationBar x:Key="GlobalApplicationBar" IsVisible="True" IsMenuEnabled="True">
    <Shell:ApplicationBar.Buttons>
        <Shell:ApplicationBarIconButton x:Name="CalculaterAppIconButton" Click="CalculaterMenuItemClick" IconUri="/Images/Icons/32/Back.png" Text="Main" />
        <Shell:ApplicationBarIconButton x:Name="HistoryAppIconButton" Click="HistoryMenuItemClick" IconUri="/Images/Icons/32/Intl-History.png" Text="History" />
        <Shell:ApplicationBarIconButton x:Name="StatisticsAppIconButton" Click="StatisticsMenuItemClick" IconUri="/Images/Icons/32/Stats.png" Text="Stats" />
        <Shell:ApplicationBarIconButton x:Name="OptionsAppIconButton" Click="OptionsMenuItemClick" IconUri="/Images/Icons/32/Settings.png" Text="Options" />
    </Shell:ApplicationBar.Buttons>
    <Shell:ApplicationBar.MenuItems>
        <Shell:ApplicationBarMenuItem x:Name="StartingHandsMenuItem" Click="StartingHandsMenuItemClick" Text="Starting Hands" />
        <Shell:ApplicationBarMenuItem x:Name="HoleOddsMenuItem" Click="HoleOddsMenuItemClick" Text="Hole Odds" />
    </Shell:ApplicationBar.MenuItems>
</Shell:ApplicationBar> 

AppBar in Phone Application Page:

ApplicationBar="{StaticResource GlobalApplicationBar}"   //In my page.xaml