I'm working on a wp7 application which consists of two xaml pages. Pages are Page1 and Page2. Page1 consists of a slider which has a range of values between 0 to 10. My program is,if I slide the slider to reach value = 10,it should navigate to Page2. So far so good. But when Page2 is loaded,I want my slider to set its value to 0. But when I press the "back" key on my windows phone,the Page2 navigates to Page1 & the slider has the value = 10 (which should be 0). I cannot do the coding of slider from Page2 because it cannot access it! How should I do it?
The program for Page1(MainPage) is
namespace ProgressBar
{
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
}
private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (slider1.Value == 10)
{
NavigationService.Navigate(new Uri("/Page2.xaml", UriKind.Relative));
}
}
}
}