Flyouts on button click event RRS feed

  • Question

  • Hi,


     I want to create two  flyouts in  which should I have a button and on click of a button I want to navigate on to another flyout I have got the code for the same but the whole xaml content is added in the xaml.cs file , how can i use the same code and write the xaml content (ui content) in the xaml .I have created the xaml page to show on that button click event.But how to link that page with the flyout arguments??

    Code snippet that I got:



    privatevoidFlyoutButton_Click(objectsender, RoutedEventArgse)



    //make up some content (this can be a user control as well!)


    StackPanels = newStackPanel();


    TextBlockt = newTextBlock() { TextWrapping = TextWrapping.Wrap };


    //fill in some lebrowski ipsum

                t.Text =

    "This Chinaman who peed on my rug, I can't go give him a bill so what the fuck are you talking about? Please see him, Jeffrey. He's a good man. And thorough. Well sure, look at it! Young trophy wife, I mean, in the parlance of our times, owes money all over town, including to known pornographers— and that's cool, that's cool. DO YOU SEE WHAT HAPPENS, LARRY?\r\rI don't like you sucking around bothering our citizens, Lebowski. Yeah? What do you think happens when you get divorced? You turn in your library card? Get a new driver's license? Stop being Jewish? Do you have any kalhua? If the plan gets too complex something always goes wrong. If there's one thing I learned in Nam—. \"My son can't hold a job, my daughter's married to a fuckin' loser, and I got a rash on my ass so bad I can't hardly siddown. But you know me. I can't complain.\".";

                t.Margin =



    newToggleSwitch() { Header = "useless switch"});



    //now create the flyout


    Flyoutf = newFlyout(


    newSolidColorBrush(Colors.White),//the foreground color of all flyouts


    Brush)App.Current.Resources["ApplicationPageBackgroundThemeBrush"],//the background color of all flyouts


    newSolidColorBrush(Color.FromArgb(255, 255, 0, 0)),//the theme brush of the app




    bool)wideModeBox.IsChecked) ? FlyoutDimension.Wide : FlyoutDimension.Narrow,//switch between narrow and wide depending on the check box


                f.OnClosing += f_OnClosing;









    Monday, December 3, 2012 2:30 PM