Search code examples
c#xamlwindows-8.1flyout

Programmatically launch a button's flyout


I am generating buttons in my app in C# and when the button is generated and the flyout properties are set for that button I want to launch the flyout. I can't find any way to simulate a click on the button in winRT, nor any methods for actually showing the flyout. Is there a way to do this?

When I talk about flyouts I am talking about these: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.flyout.aspx

Not settings flyouts.


Solution

  • There's a ShowAt method on the Flyout class...

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.primitives.flyoutbase.showat.aspx

    Or a static method ShowAttachedFlyout to use on the Button itself

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.primitives.flyoutbase.showattachedflyout.aspx