Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Silverlight5
In my Application i Have two TabItem when i change Tab item then Frame History is lost, when i again select frame tab. I don't to destroy frame history.
Here is my Code
Xaml Side
        <StackPanel Orientation="Vertical">
            <StackPanel Orientation="Horizontal">
                <Button Content="Back" Height="25" x:Name="btnBack" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Left" Click="btnBack_Click" />
                <Button Content="Forward" Height="25" x:Name="btnForward" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Left" Click="btnForward_Click_1" />
                <Button Content="page1" Height="25" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Right" Click="Button_Click_1"/>
                <Button Content="page2" Height="25" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Right" Click="Button_Click_2"/>
                <Button Content="page3" Height="25" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Right" Click="Button_Click_3"/>
            <navigation:Frame x:Name="mainFrame" Source="/Page2.xaml" Margin="0,20,0,0" Navigated="mainFrame_Navigated_1">
Code Side
 private void Button_Click_1(object sender, RoutedEventArgs e)
            if (mainFrame.CanGoBack)
        private void Button_Click_2(object sender, RoutedEventArgs e)
            if (mainFrame.CanGoForward)
        private void Button_Click_3(object sender, RoutedEventArgs e)
            mainFrame.Navigate(new Uri("/Pages/Page2.xaml", UriKind.Relative));
            //mainFrame.Content = new Page3();
        private void Button_Click_4(object sender, RoutedEventArgs e)
            mainFrame.Navigate(new Uri("/Pages/Page3.xaml", UriKind.Relative));
            //mainFrame.Content = new Page2();
        private void mainFrame_Navigated(object sender, NavigationEventArgs e)
            if (mainFrame.CanGoBack)
                btnBack.IsEnabled = true;
                btnBack.IsEnabled = false;
            if (mainFrame.CanGoForward)
                btnForward.IsEnabled = true;
                btnForward.IsEnabled = false;
Please help to Solve this Problem
Posted 11-Feb-13 3:37am
Edited 11-Feb-13 5:20am
(no name)114.2K

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 384
1 Maciej Los 290
2 Sergey Alexandrovich Kryukov 230
3 CPallini 170
4 Shweta N Mishra 165
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785

Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100