0

Here is my problem. After I select iten I have 4 options to click, then each options give me 4 additional final options.

So now I have command bar:

enter image description here

And now after I click one of buttons I want to show another command bar above the first one:

enter image description here

Is it possible with winRT for Windows Phone 8.1? Or maybe show some Fly Menu with icons?

like so:

enter image description here

here is code for adding FlyOut menu but ... when i click sendBtn everything gets grey but nothing is shown ;/

MenuFlyout testMenu = new MenuFlyout();
MenuFlyoutItem item1 = new MenuFlyoutItem();
item1.Text = "Test1";
MenuFlyoutItem item2 = new MenuFlyoutItem();
item1.Text = "Test2";
testMenu.Items.Add(item1);
testMenu.Items.Add(item2);

AppBarButton sendBtn = new AppBarButton();
sendBtn.Label = textLoader.GetString("SendToService");
sendBtn.Icon = new SymbolIcon(Symbol.Mail);
sendBtn.Flyout = testMenu;
command_bar.PrimaryCommands.Add(sendBtn);
Romasz
  • 29,662
  • 13
  • 79
  • 154
Jakub Wisniewski
  • 2,189
  • 4
  • 20
  • 34

1 Answers1

1

As for your main question - there is no possiblity to make double commandbar. Though you may build your own control and implement such functionality.

As for your code - in my case it seems to work - I've tried like this:

CommandBar command_bar;
public MainPage()
{
    this.InitializeComponent();
    command_bar = new CommandBar();
    MenuFlyout testMenu = new MenuFlyout();
    MenuFlyoutItem item1 = new MenuFlyoutItem();
    item1.Text = "Test1";
    MenuFlyoutItem item2 = new MenuFlyoutItem();
    item2.Text = "Test2";
    testMenu.Items.Add(item1);
    testMenu.Items.Add(item2);
    AppBarButton sendBtn = new AppBarButton();
    sendBtn.Label = "SendToService";
    sendBtn.Icon = new SymbolIcon(Symbol.Mail);
    sendBtn.Flyout = testMenu;
    command_bar.PrimaryCommands.Add(sendBtn);
    BottomAppBar = command_bar;
}

You have one mistake - your second MenuItem has empty label - you change the first twice.

Also if you encounter problem with bad positioning of your flyout then this answer may help.

Community
  • 1
  • 1
Romasz
  • 29,662
  • 13
  • 79
  • 154