Template10 icon indicating copy to clipboard operation
Template10 copied to clipboard

Page.BottomAppBar causing issues with hamburger

Open GJKuz opened this issue 10 years ago • 6 comments

Replacing Page.BottomAppBar with below in BottomAppBar sample, results in weird hamburger menu behavior once state trigger fires for Wide width. The settings button gets buried under the command bar and the only way to bring it up is by clicking the "..." on command bar.

<Page.BottomAppBar>
        <CommandBar x:Name="bottomBar" Visibility="Visible">
            <AppBarButton Label="Calculate" Icon="Calculator"/>
            <AppBarButton Label="Clear"  Icon="Clear"/>
            <AppBarButton Label="Home"  Icon="Home"/>
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="Launch Settings"  />
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </Page.BottomAppBar>

I also have another issue. I only want to display BottomAppBar for narrow state. When the state trigger fires for normal width, I want to switch BottomAppBar with TopAppBar. When I do that the hamburger control, doesn't stretch automatically and leaves a 48x48 area at the bottom which is in white. Really appreciate some guidance.

GJKuz avatar Dec 11 '15 04:12 GJKuz

There is a bug, this works with AppBar but not CommandBar.

JerryNixon avatar Dec 11 '15 21:12 JerryNixon

Thanks Jerry for the update.

GJKuz avatar Dec 12 '15 02:12 GJKuz

Okay, the native functionality to hand the BottomAppBar has been removed from the library. Why? Because the work to handle it is so trivial, it did not make sense to include that complexity in the control. I have updated the BottomAppBar sample to help you implement it yourself.

JerryNixon avatar Jan 08 '16 00:01 JerryNixon

The "fix" in BottomAppBar sample is not working correctly on phones, or when the window is in VisualStateNarrow. Since the PaneWidth is hardcoded at 48 pixels, the BottomAppBar will always be 48 pixels shorter even when the menu is closed, and changing the code to 0 pixels would make the BottomAppBar overlap the HamburgerMenu when it's in VisualStateNormal. Wouldn't it be better to change the height of the HamburgerMenu instead?

DanTheManSWE avatar Jan 13 '16 13:01 DanTheManSWE

Not sure if you read this post when it's closed, but one way to solve it could be to expose PaneContent Margin property. I just tried to change that margin to 0,48,0,48, and it works fine.

DanTheManSWE avatar Jan 13 '16 17:01 DanTheManSWE

I found a Workaround for the BottomAppBar issue. Make sure you create another PageHeader Control and set the PageHeader control as 'AlignBottomWithPanel="True"

Refer the Code Below.

        <controls:PageHeader x:Name="pageFooter" RelativePanel.AlignLeftWithPanel="True"
            RelativePanel.AlignRightWithPanel="True"
            RelativePanel.AlignBottomWithPanel="True">
            <!--  primary commands  -->
            <controls:PageHeader.PrimaryCommands>
                <AppBarButton Icon="Accept" Label="Settings" />
            </controls:PageHeader.PrimaryCommands>
        </controls:PageHeader>

untitled

JijoBose avatar Jun 26 '16 05:06 JijoBose