uwpcommandbar

Hiding the ellipse button in command bar


I am trying to show the ellipse button in the command bar only when it is in a Minimal mode.

So far, the command bar isn't showing the ellipse button when on launched, this is how it looks like:

When on launched

So when I clicked on my hide button, which is the last button in the picture above, this is how it looks like (in Minimal mode):

*it is quite hard to see, but the ellipse is showing....

in mininal mode

So here comes the problem

When I click on the command bar again when it is in the mininal mode (second picture), it looks like this:

clicked when  in mininal mode

With the ellipse button showing.... I want the command bar to look like how it looks like when on launched (first picture) when I clicked on the command bar again...


Solution

  • OverflowButtonVisibility = Collapsed in Opening event and OverflowButtonVisibility = Visible in Closing event

    private void MyCommandBar_Opening(object sender, object e)
    {
        MyCommandBar.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Collapsed;
    }
    
    private void MyCommandBar_Closing(object sender, object e)
    {
        MyCommandBar.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Visible;
    }
    

    enter image description here