0

By using Callisto I wrote a code that adds setting charms.

Underneath I attach one:

// Register handler for CommandsRequested events from the setting pane
SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;

void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    // Add an Adding Feeds command
    var add = new SettingsCommand("add", "Add new Feed", (handler) =>
    {
        var settings = new SettingsFlyout();
        settings.Content = new AddingPageUserControl();
        settings.HeaderBrush = (SolidColorBrush)Application.Current.Resources["UserControlBackgraund"];
        settings.Background = (SolidColorBrush)Application.Current.Resources["UserControlBackgraund"];
        settings.HeaderText = "Add new Feed";
        settings.IsOpen = true;
    });

    args.Request.ApplicationCommands.Add(add);
}

And I don't know how to create a button in AppBar which opens the same setting flyout as I use to open it by setting charms. My question is: is it possible to create it if yes I need a sort of hint.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
rechandler
  • 756
  • 8
  • 22

1 Answers1

0

You can find the AppBar using Page.BottomAppBar and use FindName method to find a specific button and add a handler to that. The only point is you are currently creating your SettingFlyout inside an anonymous function, so only place you can do that would be inside your anonymous function.

n00b
  • 1,832
  • 14
  • 25