locked
How to programmatically open a CharmFlyout user control? RRS feed

  • Question

  • Hi,

    I'm building a Windows 8 Store app using c#/XAML using MVVM (no framework).  I'm using the CharmFlyoutLibrary for my application settings.  I have a parent/child settings configured. I have created a "getting started" page and I would like to open the application settings flyout page/control open programmatically. I can get the Settings Pane to open easily enough. I have tried quite a few option for opening the application settings flyout directly but I can't figure out how to make it work. 

    Does anyone know how to open a CharmFlyout flyout programmatically from code?

    Thanks,

    Mike


    blog - http://www.codesmartnothard.com

    Sunday, July 7, 2013 1:11 PM

Answers

  • There isn't a direct way to trigger specific settings through the charms, just the settings pane itself. That said, your app is in charge of showing the settings flyout and so can display it on its own whenever it wants.

    I don't know details about how you would do this with your third party library.

    --Rob

    Sunday, July 7, 2013 5:19 PM
    Moderator

All replies

  • There isn't a direct way to trigger specific settings through the charms, just the settings pane itself. That said, your app is in charge of showing the settings flyout and so can display it on its own whenever it wants.

    I don't know details about how you would do this with your third party library.

    --Rob

    Sunday, July 7, 2013 5:19 PM
    Moderator
  • Here is code which will launch the settings flyout. Below are the changes to Windows 8 app samples -> App settings sample (not Windows 8.1) to launch the settings directly

    SettingsFlyoutScenario.xaml

    <Button x:Name="showSettings" Grid.Row="1" Content="Show Settings" Margin="0,0,10,0" Click="showSettings_Click"/>
    
      private void showSettings_Click(object sender, RoutedEventArgs e)
            {
                onSettingsCommand(null);
            }



    Thanks,
    Sachin
    My Samples

    Monday, July 8, 2013 1:16 AM
  • Rob,

    Thanks for the reply but I was looking for something specific to the CharmFlyoutLibrary.  I tired to "unpropose as answer" but I received an unexpected error twice in IE and once is Chrome. Would you change this?

    Thanks,

    Mike


    blog - http://www.codesmartnothard.com

    Monday, July 8, 2013 11:17 AM
  • Hi Sachin,

    Thanks for the reply.  I opened the sample and tried to implement that code but it didn't work either.  I think it is because the CharmFlyoutLibrary uses flyout controls on the user control as the pages.  I believe this code expects the user control to be the page.  I might have to use a different framework or roll my own like in the sample code.

    I didn't know about the Windows 8 samples (and 8.1).  That is a great tip.

    Thanks,

    Mike


    blog - http://www.codesmartnothard.com

    Monday, July 8, 2013 11:26 AM